import type { ReactNode } from 'react'
import { render, screen } from '@testing-library/react'
import MainNavLayout from '../layout'
vi.mock('@/app/components/header', () => ({
default: () =>
Header
,
}))
vi.mock('@/app/components/header/header-wrapper', () => ({
default: ({ children }: { children: ReactNode }) => {children}
,
}))
vi.mock('../index', () => ({
default: ({ className }: { className?: string }) => ,
}))
describe('MainNavLayout', () => {
beforeEach(() => {
localStorage.clear()
})
it('renders desktop main nav instead of the desktop header', () => {
render(content
)
expect(screen.getByTestId('main-nav')).toBeInTheDocument()
expect(screen.queryByTestId('desktop-header')).not.toBeInTheDocument()
expect(screen.getByText('content')).toBeInTheDocument()
})
it('uses the main nav without the desktop header wrapper', () => {
render(content
)
expect(screen.getByTestId('main-nav')).toBeInTheDocument()
expect(screen.queryByTestId('header-wrapper')).not.toBeInTheDocument()
expect(screen.queryByTestId('desktop-header')).not.toBeInTheDocument()
})
})