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,103 +0,0 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`<Checkbox /> renders correctly 1`] = `
<div
className="input boolean"
>
<input
type="checkbox"
/>
</div>
`;
exports[`<FieldsGroup /> renders correctly 1`] = `
<div
className="fields-group"
/>
`;
exports[`<FileChooser /> renders correctly 1`] = `
<div
className="input"
>
<input
accept={
Array [
"image/jpeg",
"image/png",
"image/gif",
"image/webp",
]
}
type="file"
/>
</div>
`;
exports[`<InputContainer /> renders correctly 1`] = `
<div
className="input"
/>
`;
exports[`<RadioGroup /> renders correctly 1`] = `
<div
className="input with_floating_label radio_buttons"
>
<div
className="label_input"
>
<label />
<ul />
</div>
</div>
`;
exports[`<SelectDropdown /> renders correctly 1`] = `
<select
className="pl-3 pr-10 py-2 text-base border-gray-300 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm rounded-md"
>
<option
value="one"
>
One
</option>
<option
value="two"
>
Two
</option>
<option
value="three"
>
Three
</option>
</select>
`;
exports[`<SimpleForm /> renders correctly 1`] = `
<form
acceptCharset="UTF-8"
className="simple_form"
method="post"
onSubmit={[Function]}
/>
`;
exports[`<SimpleInput /> renders correctly 1`] = `
<div
className="input"
>
<input />
</div>
`;
exports[`<TextInput /> renders correctly 1`] = `
<div
className="input"
>
<input
type="text"
/>
</div>
`;

View File

@ -1,86 +0,0 @@
import React from 'react';
import renderer from 'react-test-renderer';
import {
InputContainer,
SimpleInput,
SimpleForm,
FieldsGroup,
Checkbox,
RadioGroup,
SelectDropdown,
TextInput,
FileChooser,
} from '..';
describe('<InputContainer />', () => {
it('renders correctly', () => {
expect(renderer.create(
<InputContainer />,
).toJSON()).toMatchSnapshot();
});
});
describe('<SimpleInput />', () => {
it('renders correctly', () => {
expect(renderer.create(
<SimpleInput />,
).toJSON()).toMatchSnapshot();
});
});
describe('<SimpleForm />', () => {
it('renders correctly', () => {
expect(renderer.create(
<SimpleForm />,
).toJSON()).toMatchSnapshot();
});
});
describe('<FieldsGroup />', () => {
it('renders correctly', () => {
expect(renderer.create(
<FieldsGroup />,
).toJSON()).toMatchSnapshot();
});
});
describe('<Checkbox />', () => {
it('renders correctly', () => {
expect(renderer.create(
<Checkbox />,
).toJSON()).toMatchSnapshot();
});
});
describe('<RadioGroup />', () => {
it('renders correctly', () => {
expect(renderer.create(
<RadioGroup />,
).toJSON()).toMatchSnapshot();
});
});
describe('<SelectDropdown />', () => {
it('renders correctly', () => {
expect(renderer.create(
<SelectDropdown items={{ one: 'One', two: 'Two', three: 'Three' }} />,
).toJSON()).toMatchSnapshot();
});
});
describe('<TextInput />', () => {
it('renders correctly', () => {
expect(renderer.create(
<TextInput />,
).toJSON()).toMatchSnapshot();
});
});
describe('<FileChooser />', () => {
it('renders correctly', () => {
expect(renderer.create(
<FileChooser />,
).toJSON()).toMatchSnapshot();
});
});