diff options
| author | Kagami Sascha Rosylight <saschanaz@outlook.com> | 2023-07-13 01:41:55 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-07-13 08:41:55 +0900 |
| commit | b6a432fd7bed95b1bc5ea624cfd9b9e742da0c68 (patch) | |
| tree | 0c91674f18f577de87fdc015c84a326046dcc064 /packages/frontend/src/components/global/MkAd.stories.impl.ts | |
| parent | fix(locales, storybook): use default import (#11259) (diff) | |
| download | misskey-b6a432fd7bed95b1bc5ea624cfd9b9e742da0c68.tar.gz misskey-b6a432fd7bed95b1bc5ea624cfd9b9e742da0c68.tar.bz2 misskey-b6a432fd7bed95b1bc5ea624cfd9b9e742da0c68.zip | |
fix(storybook): solve test failures (#11262)
* fix(locales, storybook): use default import
* fix(storybook): solve test failures
* Update MkAd.stories.impl.ts
Diffstat (limited to 'packages/frontend/src/components/global/MkAd.stories.impl.ts')
| -rw-r--r-- | packages/frontend/src/components/global/MkAd.stories.impl.ts | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/packages/frontend/src/components/global/MkAd.stories.impl.ts b/packages/frontend/src/components/global/MkAd.stories.impl.ts index 7d8a42a03c..58b6cc14c4 100644 --- a/packages/frontend/src/components/global/MkAd.stories.impl.ts +++ b/packages/frontend/src/components/global/MkAd.stories.impl.ts @@ -1,9 +1,9 @@ /* eslint-disable @typescript-eslint/explicit-function-return-type */ import { expect } from '@storybook/jest'; -import { userEvent, within } from '@storybook/testing-library'; +import { userEvent, waitFor, within } from '@storybook/testing-library'; import { StoryObj } from '@storybook/vue3'; -import { i18n } from '@/i18n'; import MkAd from './MkAd.vue'; +import { i18n } from '@/i18n'; const common = { render(args) { return { @@ -36,6 +36,7 @@ const common = { const i = buttons[0]; await expect(i).toBeInTheDocument(); await userEvent.click(i); + await waitFor(() => expect(canvasElement).toHaveTextContent(i18n.ts._ad.back)); await expect(a).not.toBeInTheDocument(); await expect(i).not.toBeInTheDocument(); buttons = canvas.getAllByRole<HTMLButtonElement>('button'); @@ -49,6 +50,7 @@ const common = { await expect(back).toBeInTheDocument(); await expect(back).toHaveTextContent(i18n.ts._ad.back); await userEvent.click(back); + await waitFor(() => expect(canvas.queryByRole('img')).toBeTruthy()); if (reduce) { await expect(reduce).not.toBeInTheDocument(); } |