From 98f0adb11c1427513a506350e0b681cd9c8f2c68 Mon Sep 17 00:00:00 2001 From: Nathan Kluth Date: Mon, 4 Dec 2023 14:44:15 -0700 Subject: [PATCH] wait --- packages/shared-ui/components/cart/stories/Cart.stories.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/shared-ui/components/cart/stories/Cart.stories.tsx b/packages/shared-ui/components/cart/stories/Cart.stories.tsx index 435490f..f43ed80 100644 --- a/packages/shared-ui/components/cart/stories/Cart.stories.tsx +++ b/packages/shared-ui/components/cart/stories/Cart.stories.tsx @@ -124,6 +124,7 @@ export const API: StoryObj = { play: async ({ canvasElement, step }) => { const canvas = within(canvasElement); await step("add to cart", async () => { + await waitFor(() => expect(canvas.getByTestId("cart")).toHaveTextContent("Cart1")); await userEvent.click(canvas.getByRole("button", { name: /product1/i })); await userEvent.click(canvas.getByRole("button", { name: /product2/i })); await waitFor(() => expect(canvas.getByTestId("cart")).toHaveTextContent("Cart3"));