diff --git a/src/__tests__/_/utils/closeAllToasts.ts b/src/__tests__/_/utils/closeAllToasts.ts index aaab9a844..2f8257192 100644 --- a/src/__tests__/_/utils/closeAllToasts.ts +++ b/src/__tests__/_/utils/closeAllToasts.ts @@ -2,7 +2,7 @@ import { waitFor, screen } from "@testing-library/react"; import userEvent from "@testing-library/user-event"; export const closeAllToasts = async () => { - const toast = screen.getByRole("button", { + const toast = await screen.findByRole("button", { name: "Close Toast", }); diff --git a/src/__tests__/dashboard/[dashboardId]/widget/[widgetId]/index.spec.tsx b/src/__tests__/dashboard/[dashboardId]/widget/[widgetId]/index.spec.tsx index 4921f7874..810d285b2 100644 --- a/src/__tests__/dashboard/[dashboardId]/widget/[widgetId]/index.spec.tsx +++ b/src/__tests__/dashboard/[dashboardId]/widget/[widgetId]/index.spec.tsx @@ -41,7 +41,7 @@ describe("pages/dashboard/[dashboardId]/widget/[widgetId]/index", () => { await userEvent.keyboard("{Enter}"); await userEvent.type( - screen.getByLabelText("Entity Tab"), + await screen.findByLabelText("Entity Tab"), "User Entity View" ); await userEvent.keyboard("{Enter}"); diff --git a/src/__tests__/dashboard/[dashboardId]/widget/create.spec.tsx b/src/__tests__/dashboard/[dashboardId]/widget/create.spec.tsx index d5fe3f4b8..92418c892 100644 --- a/src/__tests__/dashboard/[dashboardId]/widget/create.spec.tsx +++ b/src/__tests__/dashboard/[dashboardId]/widget/create.spec.tsx @@ -51,7 +51,7 @@ describe("pages/dashboard/[dashboardId]/widget/create", () => { await userEvent.keyboard("{Enter}"); await userEvent.type( - screen.getByLabelText("Entity Tab"), + await screen.findByLabelText("Entity Tab"), "Verified Entity View" );