docbrown/app/javascript/article-form/components/__tests__/LoadingPreview.test.jsx
Rajat Talesra 5966960c04
Create Preview Loading screen (#17914)
* Minor changes

* Basic implementation with some bugs

* Removed files

* Correct tab selection

* Added tests

* Disabled bottom bar buttons on preview loading

* Applied other changes

* Added tests for PageTitle

* Added tests for LoadingPreview

* Added test for Options.jsx

* Removed comments

* Fixed CSS

* Removed unused code

* Fixed test failure

* Added aria-live

* Nit fixe

* Fixed tests

* Applied suggested changes
2022-07-07 19:21:50 +05:30

25 lines
736 B
JavaScript

import { h } from 'preact';
import { render } from '@testing-library/preact';
import { axe } from 'jest-axe';
import { LoadingPreview } from '..';
describe('<LoadingPreview />', () => {
it('should have no a11y violations', async () => {
const { container } = render(<LoadingPreview />);
const results = await axe(container);
expect(results).toHaveNoViolations();
});
it('should render', () => {
const { queryByTitle } = render(<LoadingPreview />);
expect(queryByTitle('Loading preview...')).toBeDefined();
});
it('should render with cover image', () => {
const { queryByTitle } = render(<LoadingPreview version="cover" />);
expect(queryByTitle('Loading preview...')).toBeDefined();
});
});