Convert old tests to use "react-testing-library"

This commit is contained in:
Justin
2022-04-04 11:53:47 -04:00
parent 9a099b3fa7
commit ed47cf5f09
71 changed files with 411 additions and 1515 deletions

View File

@ -1,40 +0,0 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`<Column /> renders correctly with minimal props 1`] = `
<div
className="relative"
column-type="filled"
role="region"
>
<div
className="space-y-4 bg-white dark:bg-slate-800 sm:shadow-lg dark:sm:shadow-inset overflow-hidden p-4 sm:rounded-xl"
>
<div
className="mb-4 flex flex-row items-center"
>
<button
aria-label="Back"
className="mr-2 text-gray-900 dark:text-gray-100"
onClick={[Function]}
>
<svg
id={
Object {
"process": [Function],
}
}
/>
<span
className="sr-only"
>
Back
</span>
</button>
<h1
className="text-xl text-gray-900 dark:text-gray-100 font-bold tracking-normal font-sans"
/>
</div>
<div />
</div>
</div>
`;

View File

@ -1,13 +0,0 @@
import React from 'react';
import { createComponent } from 'soapbox/test_helpers';
import Column from '../column';
describe('<Column />', () => {
it('renders correctly with minimal props', () => {
const component = createComponent(<Column />);
const tree = component.toJSON();
expect(tree).toMatchSnapshot();
});
});

View File

@ -0,0 +1,12 @@
import React from 'react';
import { render, screen } from '../../../../jest/test-helpers';
import Column from '../column';
describe('<Column />', () => {
it('renders correctly with minimal props', () => {
render(<Column />);
expect(screen.getByRole('button')).toHaveTextContent('Back');
});
});