mirror of
https://github.com/blakeblackshear/frigate.git
synced 2025-10-04 11:15:55 +02:00
24 lines
580 B
JavaScript
24 lines
580 B
JavaScript
import { h } from 'preact';
|
|
import Dialog from '../Dialog';
|
|
import { render, screen } from 'testing-library';
|
|
|
|
describe('Dialog', () => {
|
|
let portal;
|
|
|
|
beforeAll(() => {
|
|
portal = document.createElement('div');
|
|
portal.id = 'dialogs';
|
|
document.body.appendChild(portal);
|
|
});
|
|
|
|
afterAll(() => {
|
|
document.body.removeChild(portal);
|
|
});
|
|
|
|
test('renders to a portal', async () => {
|
|
render(<Dialog>Sample</Dialog>);
|
|
expect(screen.getByText('Sample')).toBeInTheDocument();
|
|
expect(screen.getByRole('modal').closest('#dialogs')).not.toBeNull();
|
|
});
|
|
});
|