From deb29f5ee6780290c7870752dc4af3566a1b96e4 Mon Sep 17 00:00:00 2001 From: Peter Makowski Date: Tue, 14 May 2024 11:24:20 +0200 Subject: [PATCH] chore: upgrade react-components 0.5.1 (#136) --- package-lock.json | 78 +++++++------------ package.json | 2 +- .../components/Pagination/Pagination.test.tsx | 20 ++++- 3 files changed, 44 insertions(+), 56 deletions(-) diff --git a/package-lock.json b/package-lock.json index b9e915d..5937628 100644 --- a/package-lock.json +++ b/package-lock.json @@ -22,7 +22,7 @@ "@storybook/addon-onboarding": "^1.0.10", "@storybook/blocks": "^7.6.7", "@storybook/react": "^7.6.7", - "@storybook/react-vite": "^8.0.9", + "@storybook/react-vite": "^8.0.0", "@storybook/testing-library": "^0.2.2", "@storybook/theming": "7.6.10", "@testing-library/jest-dom": "^6.1.3", @@ -63,7 +63,7 @@ "vitest": "^1.0.0" }, "peerDependencies": { - "@canonical/react-components": "0.52.0", + "@canonical/react-components": "0.53.0", "@tanstack/react-table": "^8.15.3", "@types/react": "^18.0.0", "@types/react-dom": "^18.0.0", @@ -2290,16 +2290,16 @@ "dev": true }, "node_modules/@canonical/react-components": { - "version": "0.52.0", - "resolved": "https://registry.npmjs.org/@canonical/react-components/-/react-components-0.52.0.tgz", - "integrity": "sha512-LLGRQ5pbChh07YVubb2T937iLsUK/qPITjCw342lGqv5LhF95ihSpeFkyrHXAX7NpthLW8uHrjVASsA3FtzOgg==", + "version": "0.53.0", + "resolved": "https://registry.npmjs.org/@canonical/react-components/-/react-components-0.53.0.tgz", + "integrity": "sha512-P5kbBi1iozZnxABDbZjtoMivVOgC63GZquCH9nF7TJW6qH2wXZxOhKQud+ZYAbQldLaNzz63vd2I13baVperhg==", "peer": true, "dependencies": { - "@types/jest": "29.5.11", - "@types/node": "20.8.5", - "@types/react": "18.2.46", - "@types/react-dom": "18.2.18", - "@types/react-table": "7.7.19", + "@types/jest": "29.5.12", + "@types/node": "20.12.11", + "@types/react": "18.3.1", + "@types/react-dom": "18.3.0", + "@types/react-table": "7.7.20", "classnames": "2.5.1", "jest-environment-jsdom": "29.7.0", "lodash.isequal": "4.5.0", @@ -2317,40 +2317,23 @@ } }, "node_modules/@canonical/react-components/node_modules/@types/node": { - "version": "20.8.5", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.8.5.tgz", - "integrity": "sha512-SPlobFgbidfIeOYlzXiEjSYeIJiOCthv+9tSQVpvk4PAdIIc+2SmjNVzWXk9t0Y7dl73Zdf+OgXKHX9XtkqUpw==", + "version": "20.12.11", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.12.11.tgz", + "integrity": "sha512-vDg9PZ/zi+Nqp6boSOT7plNuthRugEKixDv5sFTIpkE89MmNtEArAShI4mxuX2+UrLEe9pxC1vm2cjm9YlWbJw==", "peer": true, "dependencies": { - "undici-types": "~5.25.1" - } - }, - "node_modules/@canonical/react-components/node_modules/@types/react": { - "version": "18.2.46", - "resolved": "https://registry.npmjs.org/@types/react/-/react-18.2.46.tgz", - "integrity": "sha512-nNCvVBcZlvX4NU1nRRNV/mFl1nNRuTuslAJglQsq+8ldXe5Xv0Wd2f7WTE3jOxhLH2BFfiZGC6GCp+kHQbgG+w==", - "peer": true, - "dependencies": { - "@types/prop-types": "*", - "@types/scheduler": "*", - "csstype": "^3.0.2" + "undici-types": "~5.26.4" } }, "node_modules/@canonical/react-components/node_modules/@types/react-dom": { - "version": "18.2.18", - "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.2.18.tgz", - "integrity": "sha512-TJxDm6OfAX2KJWJdMEVTwWke5Sc/E/RlnPGvGfS0W7+6ocy2xhDVQVh/KvC2Uf7kACs+gDytdusDSdWfWkaNzw==", + "version": "18.3.0", + "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.3.0.tgz", + "integrity": "sha512-EhwApuTmMBmXuFOikhQLIBUn6uFg81SwLMOAUgodJF14SOBOCMdU04gDoYi0WOJJHD144TL32z4yDqCW3dnkQg==", "peer": true, "dependencies": { "@types/react": "*" } }, - "node_modules/@canonical/react-components/node_modules/undici-types": { - "version": "5.25.3", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.25.3.tgz", - "integrity": "sha512-Ga1jfYwRn7+cP9v8auvEXN1rX3sWqlayd4HP7OKk4mZWylEmu3KzXDUGrQUN6Ol7qo1gPvB2e5gX6udnyEPgdA==", - "peer": true - }, "node_modules/@colors/colors": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.5.0.tgz", @@ -10388,9 +10371,9 @@ } }, "node_modules/@types/jest": { - "version": "29.5.11", - "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.5.11.tgz", - "integrity": "sha512-S2mHmYIVe13vrm6q4kN6fLYYAka15ALQki/vgDC3mIukEOx8WJlv0kQPM+d4w8Gp6u0uSdKND04IlTXBv0rwnQ==", + "version": "29.5.12", + "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.5.12.tgz", + "integrity": "sha512-eDC8bTvT/QhYdxJAulQikueigY5AsdBRH2yDKW3yveW7svY3+DzN84/2NUgkw10RTiJbWqZrTtoGVdYlvFJdLw==", "peer": true, "dependencies": { "expect": "^29.0.0", @@ -10558,9 +10541,9 @@ "dev": true }, "node_modules/@types/react": { - "version": "18.2.79", - "resolved": "https://registry.npmjs.org/@types/react/-/react-18.2.79.tgz", - "integrity": "sha512-RwGAGXPl9kSXwdNTafkOEuFrTBD5SA2B3iEB96xi8+xu5ddUa/cpvyVCSNn+asgLCTHkb5ZxN8gbuibYJi4s1w==", + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/@types/react/-/react-18.3.1.tgz", + "integrity": "sha512-V0kuGBX3+prX+DQ/7r2qsv1NsdfnCLnTgnRJ1pYnxykBhGMz+qj+box5lq7XsO5mtZsBqpjwwTu/7wszPfMBcw==", "dependencies": { "@types/prop-types": "*", "csstype": "^3.0.2" @@ -10576,9 +10559,9 @@ } }, "node_modules/@types/react-table": { - "version": "7.7.19", - "resolved": "https://registry.npmjs.org/@types/react-table/-/react-table-7.7.19.tgz", - "integrity": "sha512-47jMa1Pai7ily6BXJCW33IL5ghqmCWs2VM9s+h1D4mCaK5P4uNkZOW3RMMg8MCXBvAJ0v9+sPqKjhid0PaJPQA==", + "version": "7.7.20", + "resolved": "https://registry.npmjs.org/@types/react-table/-/react-table-7.7.20.tgz", + "integrity": "sha512-ahMp4pmjVlnExxNwxyaDrFgmKxSbPwU23sGQw2gJK4EhCvnvmib2s/O/+y1dfV57dXOwpr2plfyBol+vEHbi2w==", "peer": true, "dependencies": { "@types/react": "*" @@ -10590,12 +10573,6 @@ "integrity": "sha512-A4STmOXPhMUtHH+S6ymgE2GiBSMqf4oTvcQZMcHzokuTLVYzXTB8ttjcgxOVaAp2lGwEdzZ0J+cRbbeevQj1UQ==", "dev": true }, - "node_modules/@types/scheduler": { - "version": "0.16.4", - "resolved": "https://registry.npmjs.org/@types/scheduler/-/scheduler-0.16.4.tgz", - "integrity": "sha512-2L9ifAGl7wmXwP4v3pN4p2FLhD0O1qsJpvKmNin5VA8+UvNVb447UDaAEV6UdrkA+m/Xs58U1RFps44x6TFsVQ==", - "peer": true - }, "node_modules/@types/semver": { "version": "7.5.8", "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.8.tgz", @@ -29240,8 +29217,7 @@ "node_modules/undici-types": { "version": "5.26.5", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", - "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", - "dev": true + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==" }, "node_modules/unicode-canonical-property-names-ecmascript": { "version": "2.0.0", diff --git a/package.json b/package.json index 1d41ba2..1a1c29b 100644 --- a/package.json +++ b/package.json @@ -103,7 +103,7 @@ "@types/react-dom": "18.2.25" }, "peerDependencies": { - "@canonical/react-components": "0.52.0", + "@canonical/react-components": "0.53.0", "@tanstack/react-table": "^8.15.3", "@types/react": "^18.0.0", "@types/react-dom": "^18.0.0", diff --git a/src/lib/components/Pagination/Pagination.test.tsx b/src/lib/components/Pagination/Pagination.test.tsx index 66b4890..9c94c84 100644 --- a/src/lib/components/Pagination/Pagination.test.tsx +++ b/src/lib/components/Pagination/Pagination.test.tsx @@ -68,8 +68,14 @@ it("disables the buttons and input box when the disabled prop is true", () => { ); expect(screen.getByRole("spinbutton")).toBeDisabled(); - expect(screen.getByRole("button", { name: "Next page" })).toBeDisabled(); - expect(screen.getByRole("button", { name: "Previous page" })).toBeDisabled(); + expect(screen.getByRole("button", { name: "Next page" })).toHaveAttribute( + "aria-disabled", + "true", + ); + expect(screen.getByRole("button", { name: "Previous page" })).toHaveAttribute( + "aria-disabled", + "true", + ); }); it("disables the 'Previous page' button when on the first page", () => { @@ -85,7 +91,10 @@ it("disables the 'Previous page' button when on the first page", () => { />, ); - expect(screen.getByRole("button", { name: "Previous page" })).toBeDisabled(); + expect(screen.getByRole("button", { name: "Previous page" })).toHaveAttribute( + "aria-disabled", + "true", + ); }); it("disables the 'Next page' button when on the last page", () => { @@ -101,7 +110,10 @@ it("disables the 'Next page' button when on the last page", () => { />, ); - expect(screen.getByRole("button", { name: "Next page" })).toBeDisabled(); + expect(screen.getByRole("button", { name: "Next page" })).toHaveAttribute( + "aria-disabled", + "true", + ); }); it("can call a function when the 'Next page' button is pressed", async () => {