mirror of
https://github.com/suren-atoyan/monaco-react.git
synced 2026-01-25 16:02:35 +00:00
37 lines
795 B
JavaScript
37 lines
795 B
JavaScript
import React from 'react';
|
|
import Loading from '.';
|
|
import { render } from '@testing-library/react';
|
|
import '@testing-library/jest-dom/extend-expect';
|
|
|
|
describe('<Loading />', () => {
|
|
it('should check render with snapshot', () => {
|
|
const component = render(
|
|
<Loading />,
|
|
);
|
|
|
|
expect(component).toMatchSnapshot();
|
|
});
|
|
|
|
it('should check is it wrapped with <div />', () => {
|
|
const component = render(
|
|
<Loading />,
|
|
);
|
|
|
|
const { container } = component;
|
|
|
|
expect(container.firstChild.tagName).toBe('DIV');
|
|
});
|
|
|
|
it('should check content', () => {
|
|
const content = 'Loading...';
|
|
|
|
const component = render(
|
|
<Loading content={content} />,
|
|
);
|
|
|
|
const { container } = component;
|
|
|
|
expect(container.textContent).toBe(content);
|
|
});
|
|
});
|