|
1 | 1 | /* eslint-disable prettier/prettier */ |
2 | 2 |
|
3 | 3 | import { render, screen, waitFor, within } from "@testing-library/react"; |
4 | | -import userEvent from "@testing-library/user-event"; |
| 4 | +import userEvent, { |
| 5 | + PointerEventsCheckLevel, |
| 6 | +} from "@testing-library/user-event"; |
5 | 7 |
|
6 | 8 | import { AuthActions } from "@/frontend/hooks/auth/auth.actions"; |
7 | 9 | import ManageVariables from "@/pages/admin/settings/variables"; |
@@ -301,18 +303,32 @@ describe("pages/integrations/variables => credentials", () => { |
301 | 303 | ) |
302 | 304 | ); |
303 | 305 |
|
304 | | - const dialog = await screen.findByRole("dialog"); |
| 306 | + const dialog = await screen.findByRole( |
| 307 | + "dialog", |
| 308 | + {}, |
| 309 | + { |
| 310 | + timeout: 10000, |
| 311 | + } |
| 312 | + ); |
305 | 313 |
|
306 | 314 | expect(within(dialog).getByText("Create Secret")).toBeInTheDocument(); |
307 | 315 |
|
308 | | - await userEvent.type(within(dialog).getByLabelText("Key"), "NEW_SECRET"); |
| 316 | + await userEvent.type(within(dialog).getByLabelText("Key"), "NEW_SECRET", { |
| 317 | + pointerEventsCheck: PointerEventsCheckLevel.Never, |
| 318 | + }); |
309 | 319 | await userEvent.type( |
310 | 320 | within(dialog).getByLabelText("Value"), |
311 | | - "new secret" |
| 321 | + "new secret", |
| 322 | + { |
| 323 | + pointerEventsCheck: PointerEventsCheckLevel.Never, |
| 324 | + } |
312 | 325 | ); |
313 | 326 |
|
314 | 327 | await userEvent.click( |
315 | | - within(dialog).getByRole("button", { name: "Create Secret" }) |
| 328 | + within(dialog).getByRole("button", { name: "Create Secret" }), |
| 329 | + { |
| 330 | + pointerEventsCheck: PointerEventsCheckLevel.Never, |
| 331 | + } |
316 | 332 | ); |
317 | 333 |
|
318 | 334 | expect(await getToastMessage()).toBe("Secret Saved Successfully"); |
@@ -376,10 +392,17 @@ describe("pages/integrations/variables => credentials", () => { |
376 | 392 |
|
377 | 393 | expect(within(dialog).getByLabelText("Key")).toBeDisabled(); |
378 | 394 |
|
379 | | - await userEvent.type(within(dialog).getByLabelText("Value"), "__updated"); |
| 395 | + await userEvent.type( |
| 396 | + within(dialog).getByLabelText("Value"), |
| 397 | + "__updated", |
| 398 | + { |
| 399 | + pointerEventsCheck: PointerEventsCheckLevel.Never, |
| 400 | + } |
| 401 | + ); |
380 | 402 |
|
381 | 403 | await userEvent.click( |
382 | | - within(dialog).getByRole("button", { name: "Update Secret" }) |
| 404 | + within(dialog).getByRole("button", { name: "Update Secret" }), |
| 405 | + { pointerEventsCheck: PointerEventsCheckLevel.Never } |
383 | 406 | ); |
384 | 407 |
|
385 | 408 | expect(await getToastMessage()).toBe("Secret Saved Successfully"); |
|
0 commit comments