From 840c7865d359b4f38499bb0bacf5bc03dfd14dcc Mon Sep 17 00:00:00 2001 From: Xiaofan Wu Date: Mon, 10 Jul 2023 15:14:51 +1000 Subject: [PATCH] chore(deps): update dependency eslint-plugin-jest-dom to v5 --- package-lock.json | 24 ++++++++++----------- package.json | 3 +-- src/components/CheckboxGroup/index.spec.jsx | 7 +++--- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/package-lock.json b/package-lock.json index d78cc1120..2243a59d3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -61,7 +61,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", @@ -11411,8 +11411,9 @@ }, "node_modules/eslint-config-adslot/plugin": { "name": "eslint-plugin-adslot", - "version": "0.0.1", - "dev": true + "version": "1.0.0", + "dev": true, + "license": "ISC" }, "node_modules/eslint-config-prettier": { "version": "8.8.0", @@ -11602,13 +11603,12 @@ } }, "node_modules/eslint-plugin-jest-dom": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/eslint-plugin-jest-dom/-/eslint-plugin-jest-dom-4.0.3.tgz", - "integrity": "sha512-9j+n8uj0+V0tmsoS7bYC7fLhQmIvjRqRYEcbDSi+TKPsTThLLXCyj5swMSSf/hTleeMktACnn+HFqXBr5gbcbA==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-jest-dom/-/eslint-plugin-jest-dom-5.0.1.tgz", + "integrity": "sha512-zD/BjNk12R5R9cxIu8oa2HfNeDSknI3ewtN8nygIUMQuieWDnTY9Np//6a1Z3G7Y3dx3l45hCUR4EphsgRmUtA==", "dev": true, "dependencies": { "@babel/runtime": "^7.16.3", - "@testing-library/dom": "^8.11.1", "requireindex": "^1.2.0" }, "engines": { @@ -11617,6 +11617,7 @@ "yarn": ">=1" }, "peerDependencies": { + "@testing-library/dom": "^8.0.0 || ^9.0.0", "eslint": "^6.8.0 || ^7.0.0 || ^8.0.0" } }, @@ -30975,7 +30976,7 @@ "dev": true, "requires": { "@babel/runtime": "^7.12.5", - "@testing-library/dom": "^9.0.1", + "@testing-library/dom": "^9.0.0", "@types/react-dom": "^18.0.0" } }, @@ -35024,13 +35025,12 @@ } }, "eslint-plugin-jest-dom": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/eslint-plugin-jest-dom/-/eslint-plugin-jest-dom-4.0.3.tgz", - "integrity": "sha512-9j+n8uj0+V0tmsoS7bYC7fLhQmIvjRqRYEcbDSi+TKPsTThLLXCyj5swMSSf/hTleeMktACnn+HFqXBr5gbcbA==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-jest-dom/-/eslint-plugin-jest-dom-5.0.1.tgz", + "integrity": "sha512-zD/BjNk12R5R9cxIu8oa2HfNeDSknI3ewtN8nygIUMQuieWDnTY9Np//6a1Z3G7Y3dx3l45hCUR4EphsgRmUtA==", "dev": true, "requires": { "@babel/runtime": "^7.16.3", - "@testing-library/dom": "^9.0.1", "requireindex": "^1.2.0" } }, diff --git a/package.json b/package.json index 4586ec631..0c9660a23 100644 --- a/package.json +++ b/package.json @@ -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", @@ -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" diff --git a/src/components/CheckboxGroup/index.spec.jsx b/src/components/CheckboxGroup/index.spec.jsx index ad60b4572..baa16b7cb 100644 --- a/src/components/CheckboxGroup/index.spec.jsx +++ b/src/components/CheckboxGroup/index.spec.jsx @@ -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 () => { @@ -327,14 +327,15 @@ it('should work when the values are updated', async () => { render(); 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'); });