frigate/web/src/routes/__tests__/Events.test.jsx

22 lines
737 B
React
Raw Normal View History

2021-02-14 21:47:59 +03:00
import { h } from 'preact';
import Events from '../Events';
2022-03-06 07:16:31 +03:00
import { render, screen, waitForElementToBeRemoved } from 'testing-library';
2021-02-14 21:47:59 +03:00
describe('Events Route', () => {
2022-03-06 07:16:31 +03:00
beforeEach(() => {});
2021-02-14 21:47:59 +03:00
test('shows an ActivityIndicator if not yet loaded', async () => {
render(<Events limit={5} path="/events" />);
expect(screen.queryByLabelText('Loading…')).toBeInTheDocument();
});
// eslint-disable-next-line jest/no-disabled-tests
test.skip('does not show ActivityIndicator after loaded', async () => {
2021-02-14 21:47:59 +03:00
render(<Events limit={5} path="/events" />);
2022-03-06 07:16:31 +03:00
await waitForElementToBeRemoved(() => screen.queryByLabelText('Loading…'));
2021-02-14 21:47:59 +03:00
2022-03-06 07:16:31 +03:00
expect(screen.queryByLabelText('Loading…')).not.toBeInTheDocument();
2021-02-14 21:47:59 +03:00
});
});