Skip to content

Commit

Permalink
Write play test for Cart.stories.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
bartstc committed Oct 21, 2023
1 parent 795d7b1 commit 617d0a4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/pages/Cart/Cart.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { Meta, StoryObj } from "@storybook/react";
import { screen, within } from "@storybook/testing-library";
import { withRouter } from "storybook-addon-react-router-v6";

import { getClearCartHandler, getCartHandler, getProductHandler } from "utils";
Expand Down Expand Up @@ -50,4 +51,9 @@ export const Default: Story = {
],
},
},
play: async ({ canvasElement, step }) => {
within(canvasElement);

await screen.findByText("List of selected products");
},
};

0 comments on commit 617d0a4

Please sign in to comment.