fix(trading): show full node URI in trading footer (#3978)
This commit is contained in:
parent
cd6d350047
commit
0f2b86770a
@ -36,11 +36,12 @@ describe('NodeHealth', () => {
|
|||||||
describe('NodeUrl', () => {
|
describe('NodeUrl', () => {
|
||||||
it('renders correct part of node url', () => {
|
it('renders correct part of node url', () => {
|
||||||
const node = 'https://api.n99.somenetwork.vega.xyz';
|
const node = 'https://api.n99.somenetwork.vega.xyz';
|
||||||
const expectedText = node.split('.').slice(1).join('.');
|
|
||||||
|
|
||||||
render(<NodeUrl url={node} />);
|
render(<NodeUrl url={node} />);
|
||||||
|
|
||||||
expect(screen.getByText(expectedText)).toBeInTheDocument();
|
expect(
|
||||||
|
screen.getByText('api.n99.somenetwork.vega.xyz')
|
||||||
|
).toBeInTheDocument();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -65,9 +65,8 @@ interface NodeUrlProps {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const NodeUrl = ({ url }: NodeUrlProps) => {
|
export const NodeUrl = ({ url }: NodeUrlProps) => {
|
||||||
// get base url from api url, api sub domain
|
|
||||||
const urlObj = new URL(url);
|
const urlObj = new URL(url);
|
||||||
const nodeUrl = urlObj.origin.replace(/^[^.]+\./g, '');
|
const nodeUrl = urlObj.hostname;
|
||||||
return <span title={t('Connected node')}>{nodeUrl}</span>;
|
return <span title={t('Connected node')}>{nodeUrl}</span>;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user