summaryrefslogtreecommitdiff
path: root/packages/frontend/src/components/global/MkAd.stories.impl.ts
diff options
context:
space:
mode:
authorzyoshoka <107108195+zyoshoka@users.noreply.github.com>2024-05-18 12:42:26 +0900
committerGitHub <noreply@github.com>2024-05-18 12:42:26 +0900
commitdef7b8c55e342aea855e56da634994c02f56f600 (patch)
treefc4bafdb1edb6d6b6a55a33147afe382f666f214 /packages/frontend/src/components/global/MkAd.stories.impl.ts
parentUpdate FUNDING.yml (diff)
downloadmisskey-def7b8c55e342aea855e56da634994c02f56f600.tar.gz
misskey-def7b8c55e342aea855e56da634994c02f56f600.tar.bz2
misskey-def7b8c55e342aea855e56da634994c02f56f600.zip
fix(frontend): fix Chromatic test fails (#13826)
* fix: attempt to fix Chromatic test fails * chore: add comment
Diffstat (limited to 'packages/frontend/src/components/global/MkAd.stories.impl.ts')
-rw-r--r--packages/frontend/src/components/global/MkAd.stories.impl.ts8
1 files changed, 7 insertions, 1 deletions
diff --git a/packages/frontend/src/components/global/MkAd.stories.impl.ts b/packages/frontend/src/components/global/MkAd.stories.impl.ts
index a1d274382f..aef26ab92d 100644
--- a/packages/frontend/src/components/global/MkAd.stories.impl.ts
+++ b/packages/frontend/src/components/global/MkAd.stories.impl.ts
@@ -11,6 +11,10 @@ import { i18n } from '@/i18n.js';
let lock: Promise<undefined> | undefined;
+function sleep(ms: number) {
+ return new Promise(resolve => setTimeout(resolve, ms));
+}
+
const common = {
render(args) {
return {
@@ -43,6 +47,8 @@ const common = {
lock = new Promise(r => resolve = r);
try {
+ // NOTE: sleep しないと何故か落ちる
+ await sleep(100);
const canvas = within(canvasElement);
const a = canvas.getByRole<HTMLAnchorElement>('link');
// await expect(a.href).toMatch(/^https?:\/\/.*#test$/);
@@ -53,7 +59,7 @@ const common = {
const i = buttons[0];
await expect(i).toBeInTheDocument();
await userEvent.click(i);
- // await expect(canvasElement).toHaveTextContent(i18n.ts._ad.back);
+ await expect(canvasElement).toHaveTextContent(i18n.ts._ad.back);
await expect(a).not.toBeInTheDocument();
await expect(i).not.toBeInTheDocument();
buttons = canvas.getAllByRole<HTMLButtonElement>('button');