From e4ee048b8c9955a84f72604f589a23bbdf9e90fb Mon Sep 17 00:00:00 2001 From: Davit Date: Fri, 1 Mar 2024 04:09:20 +0400 Subject: [PATCH 1/2] don't continue on error --- .github/workflows/ui-workflow.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/ui-workflow.yaml b/.github/workflows/ui-workflow.yaml index 89221dc2..3dcc339d 100644 --- a/.github/workflows/ui-workflow.yaml +++ b/.github/workflows/ui-workflow.yaml @@ -72,7 +72,6 @@ jobs: auto-cancel-after-failures: 1 wait-on: 'http://localhost:3000' command: yarn cypress:runRbac - continue-on-error: true - name: Run General Cypress Tests uses: cypress-io/github-action@v6 @@ -81,7 +80,6 @@ jobs: auto-cancel-after-failures: 1 wait-on: 'http://localhost:3000' command: yarn cypress:runGeneral - continue-on-error: true - name: Run Organization Cypress Tests uses: cypress-io/github-action@v6 @@ -90,7 +88,6 @@ jobs: auto-cancel-after-failures: 1 wait-on: 'http://localhost:3000' command: yarn cypress:runOrganizations - continue-on-error: true - name: Stop Docker containers run: | From b19a7900b184f8f40aab6618425f283849385d34 Mon Sep 17 00:00:00 2001 From: Davit Date: Fri, 1 Mar 2024 04:56:16 +0400 Subject: [PATCH 2/2] add waitFor in storybook test --- src/components/Accordion/index.stories.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/Accordion/index.stories.tsx b/src/components/Accordion/index.stories.tsx index d72e8679..9d3af6c1 100644 --- a/src/components/Accordion/index.stories.tsx +++ b/src/components/Accordion/index.stories.tsx @@ -1,6 +1,6 @@ import { expect } from '@storybook/jest'; import { Meta, StoryObj } from '@storybook/react'; -import { userEvent, within } from '@storybook/testing-library'; +import { userEvent, waitFor, within } from '@storybook/testing-library'; import Accordion from './index'; @@ -51,6 +51,9 @@ export const WithChildren: Story = { ), }, play: async ({ canvasElement }) => { + // wait for sb root to render; + await waitFor(() => within(canvasElement).getByTestId('storybook-accordion')); + // toggle functionality const canvas = within(canvasElement); const element = await Promise.resolve(canvas.getByTestId('storybook-accordion'));