blakeblackshear.frigate/web/src/__tests__/Sidebar.test.jsx

18 lines
635 B
React
Raw Normal View History

2021-02-14 16:10:34 +01:00
import { h } from 'preact';
import * as Context from '../context';
import Sidebar from '../Sidebar';
2022-03-06 05:16:31 +01:00
import { render, screen } from 'testing-library';
2021-02-14 16:10:34 +01:00
describe('Sidebar', () => {
beforeEach(() => {
jest.spyOn(Context, 'useDrawer').mockImplementation(() => ({ showDrawer: true, setShowDrawer: () => {} }));
});
test('does not render cameras by default', async () => {
2022-03-06 05:16:31 +01:00
const { findByText } = render(<Sidebar />);
await findByText('Cameras');
2021-02-14 16:10:34 +01:00
expect(screen.queryByRole('link', { name: 'front' })).not.toBeInTheDocument();
expect(screen.queryByRole('link', { name: 'side' })).not.toBeInTheDocument();
});
});