Skip to content

Commit

Permalink
chore: upgrade react-components 0.5.1 (#136)
Browse files Browse the repository at this point in the history
  • Loading branch information
petermakowski authored May 14, 2024
1 parent c022141 commit deb29f5
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 56 deletions.
78 changes: 27 additions & 51 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
20 changes: 16 additions & 4 deletions src/lib/components/Pagination/Pagination.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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", () => {
Expand All @@ -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", () => {
Expand All @@ -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 () => {
Expand Down

0 comments on commit deb29f5

Please sign in to comment.