= ({ children }) => (
)
-const mockedUseFlags = useFlags as Mock
-
-beforeEach(() => {
- mockedUseFlags.mockReturnValue({ darkMode: false })
-})
-
afterEach(() => {
cleanup()
queryClient.clear()
@@ -118,19 +109,6 @@ describe('GuestHeader', () => {
)
})
})
- it('has toggle for light/dark mode when flag on', async () => {
- mockedUseFlags.mockReturnValueOnce({ darkMode: true })
- render(, { wrapper })
-
- const toggle = await screen.findByTestId('theme-toggle')
- expect(toggle).toBeInTheDocument()
- })
- it('has no toggle for light/dark mode when flag off', () => {
- render(, { wrapper })
-
- const toggle = screen.queryAllByTestId('theme-toggle')
- expect(toggle).toEqual([])
- })
})
describe('self hosted build', () => {
diff --git a/src/layouts/Header/components/GuestHeader/GuestHeader.tsx b/src/layouts/Header/components/GuestHeader/GuestHeader.tsx
index 60e2c894a3..d8a65c169d 100644
--- a/src/layouts/Header/components/GuestHeader/GuestHeader.tsx
+++ b/src/layouts/Header/components/GuestHeader/GuestHeader.tsx
@@ -1,7 +1,6 @@
import config from 'config'
import { CodecovIcon } from 'assets/svg/codecov'
-import { useFlags } from 'shared/featureFlags'
import A from 'ui/A'
import Button from 'ui/Button'
@@ -26,10 +25,6 @@ const LogoButton = () => {
}
function GuestHeader() {
- const { darkMode } = useFlags({
- darkMode: false,
- })
-
const isSelfHosted = config.IS_SELF_HOSTED
return (
@@ -71,7 +66,7 @@ function GuestHeader() {
)}
- {darkMode ? : null}
+
{isSelfHosted ? (