2021-02-14 06:37:50 +03:00
|
|
|
import { h } from 'preact';
|
|
|
|
|
import Debug from '../Debug';
|
2022-03-06 07:16:31 +03:00
|
|
|
import { render, screen, waitForElementToBeRemoved } from 'testing-library';
|
2021-02-14 06:37:50 +03:00
|
|
|
|
|
|
|
|
describe('Debug Route', () => {
|
2022-03-06 07:16:31 +03:00
|
|
|
beforeEach(() => {});
|
2021-02-14 06:37:50 +03:00
|
|
|
|
|
|
|
|
test('shows an ActivityIndicator if stats are null', async () => {
|
|
|
|
|
render(<Debug />);
|
|
|
|
|
expect(screen.queryByLabelText('Loading…')).toBeInTheDocument();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
test('shows stats and config', async () => {
|
|
|
|
|
render(<Debug />);
|
2022-03-06 07:16:31 +03:00
|
|
|
|
|
|
|
|
await waitForElementToBeRemoved(() => screen.queryByLabelText('Loading…'));
|
2021-02-14 06:37:50 +03:00
|
|
|
|
|
|
|
|
expect(screen.queryByTestId('detectors')).toBeInTheDocument();
|
|
|
|
|
expect(screen.queryByText('coral')).toBeInTheDocument();
|
|
|
|
|
|
|
|
|
|
expect(screen.queryByTestId('cameras')).toBeInTheDocument();
|
|
|
|
|
expect(screen.queryByText('front')).toBeInTheDocument();
|
|
|
|
|
expect(screen.queryByText('side')).toBeInTheDocument();
|
|
|
|
|
|
|
|
|
|
expect(screen.queryByText('Config')).toBeInTheDocument();
|
|
|
|
|
expect(screen.queryByRole('button', { name: 'Copy to Clipboard' })).toBeInTheDocument();
|
|
|
|
|
});
|
|
|
|
|
});
|