mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-02 17:25:22 +03:00
29 lines
998 B
JavaScript
29 lines
998 B
JavaScript
import { h } from 'preact';
|
|
import Debug from '../Debug';
|
|
import { render, screen, waitForElementToBeRemoved } from 'testing-library';
|
|
|
|
describe('Debug Route', () => {
|
|
beforeEach(() => {});
|
|
|
|
test('shows an ActivityIndicator if stats are null', async () => {
|
|
render(<Debug />);
|
|
expect(screen.queryByLabelText('Loading…')).toBeInTheDocument();
|
|
});
|
|
|
|
test('shows stats and config', async () => {
|
|
render(<Debug />);
|
|
|
|
await waitForElementToBeRemoved(() => screen.queryByLabelText('Loading…'));
|
|
|
|
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();
|
|
});
|
|
});
|