Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@testing-library/user-event types are fixed, remove our workaround #2278

Merged
merged 1 commit into from
Sep 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"@storybook/react-vite": "^7.2.1",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^14.0.0",
"@testing-library/user-event": "^14.4.3",
"@testing-library/user-event": "^14.5.1",
"@types/jest": "^29.5.3",
"@types/lodash": "^4.14.196",
"@types/node": "^20.4.7",
Expand Down
11 changes: 5 additions & 6 deletions packages/components/test/autorun.test.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import "@testing-library/jest-dom";
import { act, render, screen, waitFor } from "@testing-library/react";
import { userEvent } from "./user-event.js";
import { userEvent } from "@testing-library/user-event";

import { SquigglePlayground } from "../src/index.js";

Expand All @@ -14,7 +14,7 @@ test("Autorun is default", async () => {
});

test("Autorun can be switched off", async () => {
const user = userEvent.setup(); // typescript issue is due to ESM mess
const user = userEvent.setup();
act(() => render(<SquigglePlayground defaultCode="70*30" />));

expect(screen.getByTestId("autorun-controls")).toHaveAttribute(
Expand All @@ -28,10 +28,9 @@ test("Autorun can be switched off", async () => {
)
);

await act(
async () =>
await user.click(screen.getByTestId("autorun-controls").firstChild) // disable
);
await act(async () => {
await user.click(screen.getByTestId("autorun-controls").firstElementChild!); // disable
});

expect(screen.getByTestId("autorun-controls")).toHaveAttribute(
"aria-checked",
Expand Down
7 changes: 0 additions & 7 deletions packages/components/test/user-event.ts

This file was deleted.

14 changes: 7 additions & 7 deletions pnpm-lock.yaml

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

Loading