Improves RTL configuration (#13079)

- Adds plugin:jest-dom/recommended to ESLint plugins list to enforce tests best practices

- Moves import @testing-library/jest-dom/extend-expect; from setup.ts to testing-library.tsx to avoid matchers collision

- Adds @testing-library/user-event to help simulate users events
This commit is contained in:
Michael S. Molina
2021-02-11 20:32:22 -03:00
committed by GitHub
parent 870886ca2f
commit 86807e40b7
8 changed files with 56150 additions and 1036 deletions

View File

@@ -25,7 +25,7 @@ describe('ControlSetRow', () => {
const { getAllByText } = render(
<ControlSetRow controls={[<p>My Control 1</p>]} />,
);
expect(getAllByText('My Control 1')).toHaveLength(1);
expect(getAllByText('My Control 1').length).toBe(1);
});
it('renders a single row with two elements', () => {
const { getAllByText } = render(