mirror of
https://github.com/blakeblackshear/frigate.git
synced 2024-11-21 19:07:46 +01:00
add sidebar test
This commit is contained in:
parent
bbb4d10718
commit
2a33c05378
@ -9,8 +9,8 @@ describe('Sidebar', () => {
|
|||||||
jest.spyOn(Api, 'useConfig').mockImplementation(() => ({
|
jest.spyOn(Api, 'useConfig').mockImplementation(() => ({
|
||||||
data: {
|
data: {
|
||||||
cameras: {
|
cameras: {
|
||||||
front: { name: 'front', objects: { track: ['taco', 'cat', 'dog'] } },
|
front: { name: 'front', objects: { track: ['taco', 'cat', 'dog'] }, record: { enabled: true } },
|
||||||
side: { name: 'side', objects: { track: ['taco', 'cat', 'dog'] } },
|
side: { name: 'side', objects: { track: ['taco', 'cat', 'dog'] }, record: { enabled: false } },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}));
|
}));
|
||||||
@ -30,4 +30,11 @@ describe('Sidebar', () => {
|
|||||||
expect(screen.queryByRole('link', { name: 'front' })).toBeInTheDocument();
|
expect(screen.queryByRole('link', { name: 'front' })).toBeInTheDocument();
|
||||||
expect(screen.queryByRole('link', { name: 'side' })).toBeInTheDocument();
|
expect(screen.queryByRole('link', { name: 'side' })).toBeInTheDocument();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('render cameras if in camera route', async () => {
|
||||||
|
window.history.replaceState({}, 'Front Recordings', '/recording/front');
|
||||||
|
render(<Sidebar />);
|
||||||
|
expect(screen.queryByRole('link', { name: 'front' })).toBeInTheDocument();
|
||||||
|
expect(screen.queryByRole('link', { name: 'side' })).not.toBeInTheDocument();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user