diff --git a/src/components/Strip/Strip.test.tsx b/src/components/Strip/Strip.test.tsx
index 065dda1b3..7fb3ad35e 100644
--- a/src/components/Strip/Strip.test.tsx
+++ b/src/components/Strip/Strip.test.tsx
@@ -13,7 +13,7 @@ describe("Strip ", () => {
render(
Test content
-
+ ,
);
expect(screen.getByTestId("strip")).toHaveStyle({
backgroundImage: "url('test.png')",
@@ -24,7 +24,7 @@ describe("Strip ", () => {
render(
Test content
-
+ ,
);
expect(screen.getByTestId("strip")).toHaveClass("p-strip--dark");
});
@@ -33,7 +33,7 @@ describe("Strip ", () => {
render(
Test content
-
+ ,
);
expect(screen.getByTestId("strip").nodeName).toEqual("SECTION");
});
@@ -42,7 +42,7 @@ describe("Strip ", () => {
render(
Test content
-
+ ,
);
expect(screen.getByTestId("strip")).toHaveClass("is-bordered");
});
@@ -51,7 +51,7 @@ describe("Strip ", () => {
render(
Test content
-
+ ,
);
expect(screen.getByTestId("strip")).toHaveClass("is-dark");
});
@@ -60,7 +60,7 @@ describe("Strip ", () => {
render(
Test content
-
+ ,
);
expect(screen.getByTestId("strip")).toHaveClass("is-deep");
});
@@ -69,7 +69,7 @@ describe("Strip ", () => {
render(
Test content
-
+ ,
);
expect(screen.getByTestId("strip")).toHaveClass("is-light");
});
@@ -78,7 +78,7 @@ describe("Strip ", () => {
render(
Test content
-
+ ,
);
expect(screen.getByTestId("strip")).toHaveClass("is-shallow");
});
@@ -87,7 +87,7 @@ describe("Strip ", () => {
render(
Test content
-
+ ,
);
// eslint-disable-next-line testing-library/no-node-access
expect(document.querySelector(".row .col-4")).toBeInTheDocument();
@@ -97,7 +97,7 @@ describe("Strip ", () => {
render(
Test content
-
+ ,
);
// eslint-disable-next-line testing-library/no-node-access
expect(document.querySelector(".row .col-12")).not.toBeInTheDocument();
@@ -107,7 +107,7 @@ describe("Strip ", () => {
render(
Test content
-
+ ,
);
// eslint-disable-next-line testing-library/no-node-access
expect(document.querySelector(".row")).toHaveClass("row--extra");
@@ -117,7 +117,7 @@ describe("Strip ", () => {
render(
Test content
-
+ ,
);
const strip = screen.getByTestId("strip");
expect(strip).toHaveClass("p-strip");
diff --git a/src/components/SummaryButton/SummaryButton.test.tsx b/src/components/SummaryButton/SummaryButton.test.tsx
index c48e32999..c54bb025c 100644
--- a/src/components/SummaryButton/SummaryButton.test.tsx
+++ b/src/components/SummaryButton/SummaryButton.test.tsx
@@ -12,7 +12,7 @@ describe("
", () => {
summary="Showing some items"
label="Show more"
onClick={jest.fn()}
- />
+ />,
);
expect(container.firstChild).toMatchSnapshot();
@@ -21,7 +21,7 @@ describe("
", () => {
// unit tests
it("renders a spinner icon", () => {
const { container } = render(
-
+
,
);
expect(container.querySelector("i.u-animation--spin")).toBeInTheDocument();
diff --git a/src/components/Switch/Switch.test.tsx b/src/components/Switch/Switch.test.tsx
index 27212e576..fade9967f 100644
--- a/src/components/Switch/Switch.test.tsx
+++ b/src/components/Switch/Switch.test.tsx
@@ -29,7 +29,7 @@ describe("
", () => {
const { container } = render(
);
expect(container.querySelector("input.p-switch__input")).toHaveAttribute(
- "disabled"
+ "disabled",
);
});
});
diff --git a/src/components/Table/Table.test.tsx b/src/components/Table/Table.test.tsx
index 4ef8e996d..42b104e1e 100644
--- a/src/components/Table/Table.test.tsx
+++ b/src/components/Table/Table.test.tsx
@@ -10,7 +10,7 @@ describe("Table", () => {
render(
+ ,
);
expect(screen.getByTestId(TEST_ID)).toMatchSnapshot();
});
@@ -27,7 +27,7 @@ describe("Table", () => {
it("can pass additional classes", () => {
render(
-
+
,
);
expect(screen.getByTestId(TEST_ID)).toHaveClass("p-table--mobile-card");
expect(screen.getByTestId(TEST_ID)).toHaveClass("extra-class");
diff --git a/src/components/TableCell/TableCell.test.tsx b/src/components/TableCell/TableCell.test.tsx
index 7a52a32ba..45a5d8e8e 100644
--- a/src/components/TableCell/TableCell.test.tsx
+++ b/src/components/TableCell/TableCell.test.tsx
@@ -34,11 +34,11 @@ describe("TableCell", () => {
it("can add additional classes", () => {
const { container } = render(
-
+
,
);
expect(container.firstChild).toHaveClass(
"p-table__expanding-panel",
- "extra-class"
+ "extra-class",
);
});
});
diff --git a/src/components/TableHeader/TableHeader.test.tsx b/src/components/TableHeader/TableHeader.test.tsx
index 030f362b7..0534f3446 100644
--- a/src/components/TableHeader/TableHeader.test.tsx
+++ b/src/components/TableHeader/TableHeader.test.tsx
@@ -12,7 +12,7 @@ describe("TableHeader", () => {
Column 1
-
+ ,
);
expect(screen.getByRole("columnheader")).toMatchSnapshot();
});
@@ -25,11 +25,11 @@ describe("TableHeader", () => {
Column 1
-
+ ,
);
expect(screen.getByRole("columnheader")).toHaveAttribute(
"aria-sort",
- "ascending"
+ "ascending",
);
});
});
diff --git a/src/components/TablePagination/TablePagination.test.tsx b/src/components/TablePagination/TablePagination.test.tsx
index 22fadff79..85148a83e 100644
--- a/src/components/TablePagination/TablePagination.test.tsx
+++ b/src/components/TablePagination/TablePagination.test.tsx
@@ -25,7 +25,7 @@ describe("
", () => {
render(
);
expect(screen.getByRole("navigation")).toHaveTextContent(
- "Showing all 5 items"
+ "Showing all 5 items",
);
});
@@ -33,7 +33,7 @@ describe("
", () => {
render(
);
expect(screen.getByRole("navigation")).toHaveTextContent(
- "Showing 1 out of 5 items"
+ "Showing 1 out of 5 items",
);
});
@@ -43,7 +43,7 @@ describe("
", () => {
expect(screen.getByRole("navigation")).toHaveTextContent("2/page");
await userEvent.selectOptions(
screen.getByRole("combobox", { name: "Items per page" }),
- "5"
+ "5",
);
expect(screen.getByRole("navigation")).toHaveTextContent("5/page");
});
@@ -54,7 +54,7 @@ describe("
", () => {
expect(screen.getByRole("navigation")).toHaveTextContent("2/page");
await userEvent.selectOptions(
screen.getByRole("combobox", { name: "Items per page" }),
- "5"
+ "5",
);
const currentPageInput = screen.getByRole("spinbutton", {
name: "Page number",
@@ -109,7 +109,7 @@ describe("
", () => {
pageSize={pageSize}
onPageChange={handlePageChange}
onPageSizeChange={handlePageSizeChange}
- />
+ />,
);
const incButton = screen.getByRole("button", { name: "Next page" });
@@ -133,7 +133,7 @@ describe("
", () => {
pageSize={pageSize}
onPageChange={handlePageChange}
onPageSizeChange={handlePageSizeChange}
- />
+ />,
);
expect(currentPageInput).toHaveValue(1);
@@ -148,7 +148,7 @@ describe("
", () => {
pageSize={pageSize}
onPageChange={handlePageChange}
onPageSizeChange={handlePageSizeChange}
- />
+ />,
);
expect(currentPageInput).toHaveValue(2);
@@ -163,7 +163,7 @@ describe("
", () => {
pageSize={pageSize}
onPageChange={handlePageChange}
onPageSizeChange={handlePageSizeChange}
- />
+ />,
);
expect(currentPageInput).toHaveValue(1);
@@ -178,7 +178,7 @@ describe("
", () => {
pageSize={pageSize}
onPageChange={handlePageChange}
onPageSizeChange={handlePageSizeChange}
- />
+ />,
);
expect(currentPageInput).toHaveValue(5);
@@ -193,7 +193,7 @@ describe("
", () => {
pageSize={pageSize}
onPageChange={handlePageChange}
onPageSizeChange={handlePageSizeChange}
- />
+ />,
);
expect(currentPageInput).toHaveValue(5);
@@ -208,7 +208,7 @@ describe("
", () => {
pageSize={pageSize}
onPageChange={handlePageChange}
onPageSizeChange={handlePageSizeChange}
- />
+ />,
);
expect(currentPageInput).toHaveValue(4);
});
@@ -227,10 +227,10 @@ describe("
", () => {
pageSize={5}
onPageChange={jest.fn()}
onPageSizeChange={jest.fn()}
- />
- )
+ />,
+ ),
).toThrow(
- "pageSize must be a valid option in pageLimits, pageLimits is set to [10,20,50]"
+ "pageSize must be a valid option in pageLimits, pageLimits is set to [10,20,50]",
);
});
});
diff --git a/src/components/TablePagination/TablePagination.tsx b/src/components/TablePagination/TablePagination.tsx
index 435006bca..01c2a7f61 100644
--- a/src/components/TablePagination/TablePagination.tsx
+++ b/src/components/TablePagination/TablePagination.tsx
@@ -141,7 +141,7 @@ const TablePagination = (props: Props) => {
if (!pageSizeFound) {
throw new Error(
- `pageSize must be a valid option in pageLimits, pageLimits is set to [${pageLimits}]`
+ `pageSize must be a valid option in pageLimits, pageLimits is set to [${pageLimits}]`,
);
}
}
diff --git a/src/components/TablePagination/TablePaginationControls/TablePaginationControls.test.tsx b/src/components/TablePagination/TablePaginationControls/TablePaginationControls.test.tsx
index bdb1ca0de..8db665b1e 100644
--- a/src/components/TablePagination/TablePaginationControls/TablePaginationControls.test.tsx
+++ b/src/components/TablePagination/TablePaginationControls/TablePaginationControls.test.tsx
@@ -19,7 +19,7 @@ describe("
", () => {
pageSize={20}
onPageChange={jest.fn()}
onPageSizeChange={jest.fn()}
- />
+ />,
);
expect(screen.getAllByRole("button")).toMatchSnapshot();
@@ -40,10 +40,10 @@ describe("
", () => {
onPageChange={onPageChange}
onNextPage={onNextPage}
onPageSizeChange={jest.fn()}
- />
+ />,
);
await userEvent.click(
- screen.getByRole("button", { name: Label.NEXT_PAGE })
+ screen.getByRole("button", { name: Label.NEXT_PAGE }),
);
expect(onPageChange).toHaveBeenCalledWith(3);
expect(onNextPage).toHaveBeenCalledWith(3);
@@ -63,10 +63,10 @@ describe("
", () => {
onPageChange={onPageChange}
onPreviousPage={onPreviousPage}
onPageSizeChange={jest.fn()}
- />
+ />,
);
await userEvent.click(
- screen.getByRole("button", { name: Label.PREVIOUS_PAGE })
+ screen.getByRole("button", { name: Label.PREVIOUS_PAGE }),
);
expect(onPageChange).toHaveBeenCalledWith(1);
expect(onPreviousPage).toHaveBeenCalledWith(1);
@@ -86,11 +86,11 @@ describe("
", () => {
onPreviousPage={jest.fn()}
onPageSizeChange={jest.fn()}
onInputPageChange={onInputPageChange}
- />
+ />,
);
await userEvent.type(
screen.getByRole("spinbutton", { name: Label.PAGE_NUMBER }),
- "1"
+ "1",
);
expect(onInputPageChange).toHaveBeenCalledWith(21);
});
@@ -108,10 +108,10 @@ describe("
", () => {
onPreviousPage={jest.fn()}
onPageSizeChange={jest.fn()}
showPageInput={false}
- />
+ />,
);
expect(
- screen.queryByRole("spinbutton", { name: Label.PAGE_NUMBER })
+ screen.queryByRole("spinbutton", { name: Label.PAGE_NUMBER }),
).not.toBeInTheDocument();
});
@@ -128,10 +128,10 @@ describe("
", () => {
onPreviousPage={jest.fn()}
onPageSizeChange={jest.fn()}
showPageInput={false}
- />
+ />,
);
expect(document.querySelector(".description")?.textContent).toBe(
- "Showing 5 out of 100 items"
+ "Showing 5 out of 100 items",
);
});
@@ -148,10 +148,10 @@ describe("
", () => {
onPreviousPage={jest.fn()}
onPageSizeChange={jest.fn()}
displayDescription={false}
- />
+ />,
);
expect(
- document.querySelector(".description")?.textContent
+ document.querySelector(".description")?.textContent,
).not.toBeUndefined();
});
});
diff --git a/src/components/TablePagination/utils.tsx b/src/components/TablePagination/utils.tsx
index cfd62f674..1513fcad2 100644
--- a/src/components/TablePagination/utils.tsx
+++ b/src/components/TablePagination/utils.tsx
@@ -29,7 +29,7 @@ export const figureSmallScreen = () => {
export const renderChildren = (
children: ReactNode,
dataForwardProp: string,
- data: unknown[]
+ data: unknown[],
) => {
return Children.map(children, (child) => {
return cloneElement(child as ReactElement, {
diff --git a/src/components/TableRow/TableRow.test.tsx b/src/components/TableRow/TableRow.test.tsx
index f7a1d17ce..a908b4dc6 100644
--- a/src/components/TableRow/TableRow.test.tsx
+++ b/src/components/TableRow/TableRow.test.tsx
@@ -12,7 +12,7 @@ describe("TableRow", () => {
|
-
+ ,
);
expect(screen.getByRole("row")).toMatchSnapshot();
});
diff --git a/src/components/Tabs/Tabs.test.tsx b/src/components/Tabs/Tabs.test.tsx
index a330a5b8f..340f9a302 100644
--- a/src/components/Tabs/Tabs.test.tsx
+++ b/src/components/Tabs/Tabs.test.tsx
@@ -19,7 +19,7 @@ describe("Tabs", () => {
label: "label2",
},
]}
- />
+ />,
);
expect(container).toMatchSnapshot();
});
@@ -39,17 +39,17 @@ describe("Tabs", () => {
label: "label2",
},
]}
- />
+ />,
);
// TODO: use a more appropriate attribute once the issue below is addressed:
// https://github.com/canonical-web-and-design/vanilla-framework/issues/4481
expect(screen.getByRole("link", { name: "label1" })).toHaveAttribute(
"aria-selected",
- "true"
+ "true",
);
expect(screen.getByRole("link", { name: "label2" })).toHaveAttribute(
"aria-selected",
- "false"
+ "false",
);
});
@@ -66,7 +66,7 @@ describe("Tabs", () => {
href: "/path1",
},
]}
- />
+ />,
);
expect(screen.getByRole("navigation")).toHaveClass("nav-class");
expect(screen.getByRole("list")).toHaveClass("list-class");
@@ -84,7 +84,7 @@ describe("Tabs", () => {
to: "/path",
},
]}
- />
+ />,
);
expect(screen.getByRole("button", { name: "label1" })).toBeInTheDocument();
});
@@ -103,7 +103,7 @@ describe("Tabs", () => {
to: "/path",
},
]}
- />
+ />,
);
expect(screen.queryByRole("link", { name })).not.toBeInTheDocument();
diff --git a/src/components/Textarea/Textarea.test.tsx b/src/components/Textarea/Textarea.test.tsx
index c24da6d62..8d136e017 100644
--- a/src/components/Textarea/Textarea.test.tsx
+++ b/src/components/Textarea/Textarea.test.tsx
@@ -6,7 +6,7 @@ import Textarea from "./Textarea";
describe("Textarea ", () => {
it("renders", () => {
const { container } = render(
-
+
,
);
// Get the wrapping element.
// eslint-disable-next-line testing-library/no-node-access, testing-library/no-container
@@ -61,7 +61,7 @@ describe("Textarea ", () => {
onControlEnter={() => {
console.log("OnControlEnter was here.");
}}
- />
+ />,
);
// Capture the event handler
diff --git a/src/components/Textarea/Textarea.tsx b/src/components/Textarea/Textarea.tsx
index 7b3b4a2e9..e2f0e09c4 100644
--- a/src/components/Textarea/Textarea.tsx
+++ b/src/components/Textarea/Textarea.tsx
@@ -120,7 +120,7 @@ const Textarea = ({
onControlEnter();
}
},
- [onControlEnter]
+ [onControlEnter],
);
useEffect(() => {
diff --git a/src/components/Tooltip/Tooltip.test.tsx b/src/components/Tooltip/Tooltip.test.tsx
index e36eab6e1..71cd59602 100644
--- a/src/components/Tooltip/Tooltip.test.tsx
+++ b/src/components/Tooltip/Tooltip.test.tsx
@@ -24,7 +24,7 @@ describe("Tooltip", () => {
const { container } = render(
-
+ ,
);
expect(container).toMatchSnapshot();
});
@@ -39,11 +39,11 @@ describe("Tooltip", () => {
}
>
-
+ ,
);
await act(async () => {
await userEventWithTimers.click(
- screen.getByRole("button", { name: /open the tooltip/i })
+ screen.getByRole("button", { name: /open the tooltip/i }),
);
jest.runAllTimers();
});
@@ -57,14 +57,14 @@ describe("Tooltip", () => {
render(
-
+ ,
);
await act(async () => {
await userEventWithTimers.tab();
});
jest.runAllTimers();
expect(
- screen.getByRole("button", { name: /open the tooltip/ })
+ screen.getByRole("button", { name: /open the tooltip/ }),
).toHaveAccessibleDescription("Additional description");
});
@@ -89,7 +89,7 @@ describe("Tooltip", () => {
}
>
-
+ ,
);
await act(async () => {
@@ -98,7 +98,7 @@ describe("Tooltip", () => {
});
await act(async () => {
await userEventWithTimers.click(
- screen.getByRole("link", { name: "Canonical" })
+ screen.getByRole("link", { name: "Canonical" }),
);
});
@@ -112,7 +112,7 @@ describe("Tooltip", () => {
-
+ ,
);
await act(async () => {
await userEventWithTimers.hover(screen.getByRole("button"));
@@ -145,7 +145,7 @@ describe("Tooltip", () => {
>