diff --git a/apps/explorer/src/app/components/header/header.spec.tsx b/apps/explorer/src/app/components/header/header.spec.tsx index f9518c8a7..b6a1cb184 100644 --- a/apps/explorer/src/app/components/header/header.spec.tsx +++ b/apps/explorer/src/app/components/header/header.spec.tsx @@ -2,6 +2,12 @@ import { render, screen } from '@testing-library/react'; import { Header } from './header'; import { MemoryRouter } from 'react-router-dom'; +jest.mock('@vegaprotocol/environment', () => ({ + NetworkSwitcher: () => ( +
NetworkSwitcher
+ ), +})); + jest.mock('../search', () => ({ Search: () =>
OrderList
, })); @@ -25,4 +31,10 @@ describe('Header', () => { expect(screen.getByTestId('search')).toBeInTheDocument(); }); + + it('should render network switcher', () => { + render(renderComponent()); + + expect(screen.getByTestId('network-switcher')).toBeInTheDocument(); + }); }); diff --git a/apps/explorer/src/app/components/header/header.tsx b/apps/explorer/src/app/components/header/header.tsx index f2ff15847..c70cdca18 100644 --- a/apps/explorer/src/app/components/header/header.tsx +++ b/apps/explorer/src/app/components/header/header.tsx @@ -5,6 +5,7 @@ import { t } from '@vegaprotocol/react-helpers'; import { Search } from '../search'; import { Routes } from '../../routes/route-names'; import type { Dispatch, SetStateAction } from 'react'; +import { NetworkSwitcher } from '@vegaprotocol/environment'; interface ThemeToggleProps { theme: 'light' | 'dark'; @@ -27,14 +28,17 @@ export const Header = ({ ); return (
- -

- {t('Vega Explorer')} -

- +
+ +

+ {t('Vega Explorer')} +

+ + +