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();
|
|
|
|
|
});
|
|
|
|
|
|
2023-10-15 16:14:20 +03:00
|
|
|
// 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
|
|
|
});
|
|
|
|
|
});
|