Skip to content

Commit

Permalink
chore(deps): update dependency eslint-plugin-jest-dom to v5
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaofan2406 committed Jul 10, 2023
1 parent 3bbb718 commit 840c786
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
24 changes: 12 additions & 12 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
"eslint-config-adslot": "^1.6.0",
"eslint-import-resolver-alias": "^1.1.2",
"eslint-plugin-jest": "^27.2.1",
"eslint-plugin-jest-dom": "^4.0.3",
"eslint-plugin-jest-dom": "^5.0.1",
"eslint-plugin-testing-library": "^5.11.0",
"glob": "^8.1.0",
"html-webpack-plugin": "^5.5.3",
Expand Down Expand Up @@ -186,7 +186,6 @@
"node": "^18"
},
"overrides": {
"@testing-library/dom": "^9.0.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"word-wrap": "npm:@aashutoshrathi/word-wrap@1.2.6"
Expand Down
7 changes: 4 additions & 3 deletions src/components/CheckboxGroup/index.spec.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ it('should work when there is an initial value', async () => {
);

const checkbox = within(screen.getByDts('target')).getByTestId('checkbox-input');
expect(checkbox.checked).toBe(true);
expect(checkbox).toBeChecked();
});

it('should work when the values are updated', async () => {
Expand Down Expand Up @@ -327,14 +327,15 @@ it('should work when the values are updated', async () => {
render(<Component />);

const items = screen.queryAllByTestId('checkbox');
expect(items[0]).toHaveAttribute('aria-checked', 'false');
expect(items[0]).not.toBeChecked();

await user.click(within(items[1]).getByTestId('checkbox-input'));
await user.click(within(items[2]).getByTestId('checkbox-input'));
await user.click(within(items[3]).getByTestId('checkbox-input'));
expect(items[0]).toHaveAttribute('aria-checked', 'true');
expect(items[0]).toBeChecked();

await user.click(screen.getByTestId('button'));

// eslint-disable-next-line jest-dom/prefer-checked
expect(items[0]).toHaveAttribute('aria-checked', 'mixed');
});

0 comments on commit 840c786

Please sign in to comment.