🚨(lint) update file for prettier 3.0.0

Prettier 3.0.0 comes with new standards so we need to upgrade our files
to comply with it.
This commit is contained in:
Nathan Vasse
2023-07-18 15:43:56 +02:00
committed by NathanVss
parent 5f63c2a606
commit d85f9edac8
61 changed files with 421 additions and 419 deletions

View File

@@ -103,7 +103,7 @@ describe("<Pagination/>", () => {
{ text: "2", name: "You are currently on page 2" },
{ text: "3", name: "Go to page 3" },
{ text: "navigate_next", name: "Go to next page", disabled: false },
])
]),
);
// Go to page 3.
@@ -120,7 +120,7 @@ describe("<Pagination/>", () => {
{ text: "2", name: "Go to page 2" },
{ text: "3", name: "You are currently on page 3" },
{ text: "navigate_next", name: "Go to next page", disabled: true },
])
]),
);
const previousButton = screen.getByRole("button", {
@@ -141,7 +141,7 @@ describe("<Pagination/>", () => {
{ text: "2", name: "You are currently on page 2" },
{ text: "3", name: "Go to page 3" },
{ text: "navigate_next", name: "Go to next page", disabled: false },
])
]),
);
// Go to page 1.
@@ -158,7 +158,7 @@ describe("<Pagination/>", () => {
{ text: "2", name: "Go to page 2" },
{ text: "3", name: "Go to page 3" },
{ text: "navigate_next", name: "Go to next page", disabled: false },
])
]),
);
});
it("can goto page", async () => {
@@ -176,7 +176,7 @@ describe("<Pagination/>", () => {
});
await waitFor(() =>
screen.getByRole("button", { name: "You are currently on page 60" })
screen.getByRole("button", { name: "You are currently on page 60" }),
);
// Try to go to page > 100 and verify that it goes to 100.
@@ -187,7 +187,7 @@ describe("<Pagination/>", () => {
});
await waitFor(() =>
screen.getByRole("button", { name: "You are currently on page 100" })
screen.getByRole("button", { name: "You are currently on page 100" }),
);
// Try to go to page < 1 and verify that it goes to 1.
@@ -198,7 +198,7 @@ describe("<Pagination/>", () => {
});
await waitFor(() =>
screen.getByRole("button", { name: "You are currently on page 1" })
screen.getByRole("button", { name: "You are currently on page 1" }),
);
});
});

View File

@@ -33,14 +33,14 @@ export const List = () => {
const timeout = setTimeout(() => {
// Sets the number of pages based on the number of items in the database.
pagination.setPagesCount(
Math.ceil(database.length / pagination.pageSize)
Math.ceil(database.length / pagination.pageSize),
);
// Sets the items to display on the current page.
setItems(
database.slice(
(pagination.page - 1) * pagination.pageSize,
pagination.page * pagination.pageSize
)
pagination.page * pagination.pageSize,
),
);
}, 500);
return () => {

View File

@@ -1,5 +1,5 @@
export const expectPaginationList = (
expectations: { text: string; name?: string; disabled?: boolean }[]
expectations: { text: string; name?: string; disabled?: boolean }[],
) => {
const buttons = document.querySelectorAll(".c__pagination__list > *");
expect(buttons.length).toEqual(expectations.length);