mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-02 17:25:22 +03:00
Fix tests
This commit is contained in:
parent
2a2adfaf20
commit
c82f5240b6
@ -11,7 +11,7 @@ describe('Camera Route', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
mockSetOptions = jest.fn();
|
||||
mockUsePersistence = jest.spyOn(Context, 'usePersistence').mockImplementation(() => [{}, mockSetOptions]);
|
||||
mockUsePersistence = jest.spyOn(Context, 'usePersistence').mockImplementation(() => [{}, mockSetOptions, true]);
|
||||
jest.spyOn(AutoUpdatingCameraImage, 'default').mockImplementation(({ searchParams }) => {
|
||||
return <div data-testid="mock-image">{searchParams.toString()}</div>;
|
||||
});
|
||||
@ -32,11 +32,12 @@ describe('Camera Route', () => {
|
||||
regions: false,
|
||||
},
|
||||
mockSetOptions,
|
||||
true,
|
||||
]);
|
||||
|
||||
render(<Camera camera="front" />);
|
||||
|
||||
await waitForElementToBeRemoved(() => screen.queryByLabelText('Loading…'));
|
||||
await waitForElementToBeRemoved(() => screen.queryByLabelText('Loading…'), { timeout: 10 });
|
||||
|
||||
fireEvent.click(screen.queryByText('Debug'));
|
||||
fireEvent.click(screen.queryByText('Show Options'));
|
||||
@ -47,20 +48,20 @@ describe('Camera Route', () => {
|
||||
|
||||
test('updates camera feed options to persistence', async () => {
|
||||
mockUsePersistence
|
||||
.mockReturnValueOnce([{}, mockSetOptions])
|
||||
.mockReturnValueOnce([{}, mockSetOptions])
|
||||
.mockReturnValueOnce([{}, mockSetOptions])
|
||||
.mockReturnValueOnce([{}, mockSetOptions])
|
||||
.mockReturnValueOnce([{}, mockSetOptions])
|
||||
.mockReturnValueOnce([{}, mockSetOptions])
|
||||
.mockReturnValueOnce([{}, mockSetOptions])
|
||||
.mockReturnValueOnce([{}, mockSetOptions])
|
||||
.mockReturnValueOnce([{ bbox: true }, mockSetOptions])
|
||||
.mockReturnValueOnce([{ bbox: true, timestamp: true }, mockSetOptions]);
|
||||
.mockReturnValueOnce([{}, mockSetOptions, true])
|
||||
.mockReturnValueOnce([{}, mockSetOptions, true])
|
||||
.mockReturnValueOnce([{}, mockSetOptions, true])
|
||||
.mockReturnValueOnce([{}, mockSetOptions, true])
|
||||
.mockReturnValueOnce([{}, mockSetOptions, true])
|
||||
.mockReturnValueOnce([{}, mockSetOptions, true])
|
||||
.mockReturnValueOnce([{}, mockSetOptions, true])
|
||||
.mockReturnValueOnce([{}, mockSetOptions, true])
|
||||
.mockReturnValueOnce([{ bbox: true }, mockSetOptions, true])
|
||||
.mockReturnValueOnce([{ bbox: true, timestamp: true }, mockSetOptions, true]);
|
||||
|
||||
render(<Camera camera="front" />);
|
||||
|
||||
await waitForElementToBeRemoved(() => screen.queryByLabelText('Loading…'));
|
||||
await waitForElementToBeRemoved(() => screen.queryByLabelText('Loading…'), { timeout: 10 });
|
||||
|
||||
fireEvent.click(screen.queryByText('Debug'));
|
||||
fireEvent.click(screen.queryByText('Show Options'));
|
||||
|
||||
Loading…
Reference in New Issue
Block a user