From bbb4d1071851b62a47e5f785d7a3de509c38f5d0 Mon Sep 17 00:00:00 2001 From: Jason Hunter Date: Sat, 5 Jun 2021 21:17:51 -0400 Subject: [PATCH] add/fix tests --- web/src/routes/__tests__/Cameras.test.jsx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/web/src/routes/__tests__/Cameras.test.jsx b/web/src/routes/__tests__/Cameras.test.jsx index 6fee585f4..9828e527c 100644 --- a/web/src/routes/__tests__/Cameras.test.jsx +++ b/web/src/routes/__tests__/Cameras.test.jsx @@ -12,8 +12,8 @@ describe('Cameras Route', () => { useConfigMock = jest.spyOn(Api, 'useConfig').mockImplementation(() => ({ data: { cameras: { - front: { name: 'front', objects: { track: ['taco', 'cat', 'dog'] } }, - side: { name: 'side', objects: { track: ['taco', 'cat', 'dog'] } }, + front: { name: 'front', objects: { track: ['taco', 'cat', 'dog'] }, record: { enabled: true } }, + side: { name: 'side', objects: { track: ['taco', 'cat', 'dog'] }, record: { enabled: false } }, }, }, status: 'loaded', @@ -41,6 +41,14 @@ describe('Cameras Route', () => { expect(screen.queryByText('side').closest('a')).toHaveAttribute('href', '/cameras/side'); }); + test('shows recordings link', async () => { + render(); + + expect(screen.queryByLabelText('Loading…')).not.toBeInTheDocument(); + + expect(screen.queryAllByText('Recordings')).toHaveLength(1); + }); + test('buttons toggle detect, clips, and snapshots', async () => { const sendDetect = jest.fn(); const sendClips = jest.fn();