Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
jonatanklosko committed Feb 6, 2024
1 parent 0f27e18 commit 0703b13
Show file tree
Hide file tree
Showing 7 changed files with 6,705 additions and 7,772 deletions.
2 changes: 0 additions & 2 deletions .prettierignore

This file was deleted.

Empty file removed .prettierrc.json
Empty file.
14,436 changes: 6,685 additions & 7,751 deletions package-lock.json

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions package.json
Expand Up @@ -32,7 +32,7 @@
"prepublishOnly": "npm run build",
"storybook": "start-storybook -p 6006",
"build-storybook": "build-storybook",
"format": "prettier --write **/*.{js,md,yml,json}"
"format": "prettier --write {src,stories,test,.storybook}/**/*.{js,md,yml,json} --no-error-on-unmatched-pattern"
},
"devDependencies": {
"@babel/core": "^7.17.9",
Expand All @@ -49,8 +49,9 @@
"@testing-library/react": "^13.0.1",
"babel-loader": "^8.2.4",
"coveralls": "^3.1.1",
"jest": "^27.5.1",
"prettier": "2.7.1",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"prettier": "^3.2.5",
"react": "^18.0.0",
"react-dom": "^18.0.0",
"rollup": "^2.70.1",
Expand Down
2 changes: 1 addition & 1 deletion src/ConfirmationDialog.js
Expand Up @@ -78,7 +78,7 @@ const ConfirmationDialog = ({
}

throw new Error(
`Supported button types are only "confirm" and "cancel", got: ${buttonType}`
`Supported button types are only "confirm" and "cancel", got: ${buttonType}`,
);
});

Expand Down
4 changes: 2 additions & 2 deletions stories/index.stories.js
Expand Up @@ -32,7 +32,7 @@ const WithDescription = () => {
<Button
onClick={() => {
confirm({ description: "This action is permanent!" }).then(
confirmationAction
confirmationAction,
);
}}
>
Expand Down Expand Up @@ -222,7 +222,7 @@ const WithReversedButtons = () => {
<Button
onClick={() => {
confirm({ buttonOrder: ["confirm", "cancel"] }).then(
confirmationAction
confirmationAction,
);
}}
>
Expand Down
26 changes: 13 additions & 13 deletions test/useConfirm.test.js
Expand Up @@ -63,12 +63,12 @@ describe("useConfirm", () => {
cancellationText: "No way",
confirmationText: "Yessir",
}}
/>
/>,
);
fireEvent.click(getByText("Delete"));
expect(queryByText("Remove this item?")).toBeTruthy();
expect(
queryByText("This will permanently remove the item.")
queryByText("This will permanently remove the item."),
).toBeTruthy();
expect(queryByText("No way")).toBeTruthy();
expect(queryByText("Yessir")).toBeTruthy();
Expand All @@ -80,7 +80,7 @@ describe("useConfirm", () => {
confirmOptions={{
content: <div>Arbitrary content</div>,
}}
/>
/>,
);
fireEvent.click(getByText("Delete"));
expect(queryByText("Arbitrary content")).toBeTruthy();
Expand All @@ -96,7 +96,7 @@ describe("useConfirm", () => {
}}
>
<DeleteButton confirmOptions={{ cancellationText: "Nope" }} />
</ConfirmProvider>
</ConfirmProvider>,
);
fireEvent.click(getByText("Delete"));
expect(queryByText("Yessir")).toBeTruthy();
Expand All @@ -116,7 +116,7 @@ describe("useConfirm", () => {
confirmationButtonProps: { disabled: true },
}}
/>
</ConfirmProvider>
</ConfirmProvider>,
);
fireEvent.click(getByText("Delete"));
const button = getByText("Yes");
Expand Down Expand Up @@ -156,13 +156,13 @@ describe("useConfirm", () => {
confirmOptions={{
confirmationKeyword: "DELETE",
}}
/>
/>,
);

fireEvent.click(getByText("Delete"));

const textfield = getAllByText(
(content, element) => element.tagName.toLowerCase() === "input"
(content, element) => element.tagName.toLowerCase() === "input",
)[0];

const confirmationButton = getByText("Ok");
Expand All @@ -182,13 +182,13 @@ describe("useConfirm", () => {
confirmOptions={{
confirmationKeyword: "DELETE",
}}
/>
/>,
);

fireEvent.click(getByText("Delete"));

let textfield = getAllByText(
(content, element) => element.tagName.toLowerCase() === "input"
(content, element) => element.tagName.toLowerCase() === "input",
)[0];

expect(textfield).toBeTruthy();
Expand All @@ -199,7 +199,7 @@ describe("useConfirm", () => {
fireEvent.click(getByText("Delete"));

textfield = getAllByText(
(content, element) => element.tagName.toLowerCase() === "input"
(content, element) => element.tagName.toLowerCase() === "input",
)[0];

expect(textfield.value).toEqual("");
Expand All @@ -215,7 +215,7 @@ describe("useConfirm", () => {
placeholder: "Custom placeholder",
},
}}
/>
/>,
);

fireEvent.click(getByText("Delete"));
Expand All @@ -232,7 +232,7 @@ describe("useConfirm", () => {
confirmOptions={{
hideCancelButton: false,
}}
/>
/>,
);

fireEvent.click(getByText("Delete"));
Expand All @@ -248,7 +248,7 @@ describe("useConfirm", () => {
confirmOptions={{
hideCancelButton: true,
}}
/>
/>,
);

fireEvent.click(getByText("Delete"));
Expand Down

0 comments on commit 0703b13

Please sign in to comment.