From 698fa84b5acb557707cb73ae776cb7ac0cdeb545 Mon Sep 17 00:00:00 2001 From: Kagami Sascha Rosylight Date: Thu, 13 Jul 2023 00:30:29 +0200 Subject: [PATCH] hmm --- .../frontend/src/components/global/MkAd.stories.impl.ts | 6 ++++-- 1 file 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 3e4420fad..bd6202721 100644 --- a/packages/frontend/src/components/global/MkAd.stories.impl.ts +++ b/packages/frontend/src/components/global/MkAd.stories.impl.ts @@ -36,7 +36,8 @@ const common = { const i = buttons[0]; await expect(i).toBeInTheDocument(); await userEvent.click(i); - await waitFor(() => expect(a).not.toBeInTheDocument()); + await waitFor(() => expect(canvas).toHaveTextContent(i18n.ts._ad.back)); + await expect(a).not.toBeInTheDocument(); await expect(i).not.toBeInTheDocument(); buttons = canvas.getAllByRole('button'); await expect(buttons).toHaveLength(args.__hasReduce ? 2 : 1); @@ -49,10 +50,11 @@ const common = { await expect(back).toBeInTheDocument(); await expect(back).toHaveTextContent(i18n.ts._ad.back); await userEvent.click(back); - await waitFor(() => expect(back).not.toBeInTheDocument()); + await waitFor(() => expect(canvas.queryByRole('img')).toBeTruthy()); if (reduce) { await expect(reduce).not.toBeInTheDocument(); } + await expect(back).not.toBeInTheDocument() const aAgain = canvas.getByRole('link'); await expect(aAgain).toBeInTheDocument(); const imgAgain = within(aAgain).getByRole('img');