-
Notifications
You must be signed in to change notification settings - Fork 27
Open
Labels
scope: code-infraInvolves the code-infra product (https://www.notion.so/mui-org/5562c14178aa42af97bc1fa5114000cd).Involves the code-infra product (https://www.notion.so/mui-org/5562c14178aa42af97bc1fa5114000cd).test
Description
configure eslint-plugin-testing-library and fix issues
See mui/toolpad#3648 as an implementation example.
Could also be helpful in:
- 1. [code-infra] In react tests, clean up our act() #174
- 2. Use
screenat the import level, not the mounting point level:
-import { render } from '@testing-library/react';
+import { render, screen } from '@testing-library/react';
test('renders content correctly', async () => {
- const { getByText } = render(<AppProvider>Hello world</AppProvider>);
+ render(<AppProvider>Hello world</AppProvider>);
- expect(getByText('Hello world')).toBeTruthy();
+ expect(screen.getByText('Hello world')).toBeTruthy();
});
});For example mui/material-ui#41061 (comment)
- 3. Use
userat the import level, not the mounting point level: [core] Support@mui/material@6peer dependency mui-x#14142 (comment). Actually maybe not: [code-infra] Optimize@testing-library/user-eventmaterial-ui#43804 (comment).
Metadata
Metadata
Assignees
Labels
scope: code-infraInvolves the code-infra product (https://www.notion.so/mui-org/5562c14178aa42af97bc1fa5114000cd).Involves the code-infra product (https://www.notion.so/mui-org/5562c14178aa42af97bc1fa5114000cd).test