diff options
| author | Acid Chicken (硫酸鶏) <root@acid-chicken.com> | 2023-03-25 23:35:47 +0900 |
|---|---|---|
| committer | Acid Chicken (硫酸鶏) <root@acid-chicken.com> | 2023-03-25 23:35:47 +0900 |
| commit | bc6d576a4ec15df8fb569c6e4dc0d379a2e81480 (patch) | |
| tree | bc2bae69a15217fa9cc048b8887053ee386b9a5b | |
| parent | build(#10336): interactions (diff) | |
| download | misskey-bc6d576a4ec15df8fb569c6e4dc0d379a2e81480.tar.gz misskey-bc6d576a4ec15df8fb569c6e4dc0d379a2e81480.tar.bz2 misskey-bc6d576a4ec15df8fb569c6e4dc0d379a2e81480.zip | |
build(#10336): add an interaction test for `<MkA/>`
| -rw-r--r-- | packages/frontend/src/components/global/MkA.stories.impl.ts | 18 | ||||
| -rw-r--r-- | packages/frontend/src/components/global/MkA.stories.ts | 3 |
2 files changed, 12 insertions, 9 deletions
diff --git a/packages/frontend/src/components/global/MkA.stories.impl.ts b/packages/frontend/src/components/global/MkA.stories.impl.ts index b1a88be5a3..3afec7f81a 100644 --- a/packages/frontend/src/components/global/MkA.stories.impl.ts +++ b/packages/frontend/src/components/global/MkA.stories.impl.ts @@ -25,15 +25,6 @@ export const Default = { template: '<MkA v-bind="props">Text</MkA>', }; }, - args: { - to: '#test', - }, - parameters: { - layout: 'centered', - }, -} satisfies StoryObj<typeof MkA>; -export const ContextMenu = { - ...Default, async play({ canvasElement }) { const canvas = within(canvasElement); const a = canvas.getByRole<HTMLAnchorElement>('link'); @@ -42,5 +33,14 @@ export const ContextMenu = { await tick(); const menu = canvas.getByRole('menu'); await expect(menu).toBeInTheDocument(); + await userEvent.click(a, { button: 0 }); + await tick(); + await expect(menu).not.toBeInTheDocument(); + }, + args: { + to: '#test', + }, + parameters: { + layout: 'centered', }, } satisfies StoryObj<typeof MkA>; diff --git a/packages/frontend/src/components/global/MkA.stories.ts b/packages/frontend/src/components/global/MkA.stories.ts index ce648f2d57..5bb6b3b5a8 100644 --- a/packages/frontend/src/components/global/MkA.stories.ts +++ b/packages/frontend/src/components/global/MkA.stories.ts @@ -41,6 +41,9 @@ export const Default = { await tick(); const menu = canvas.getByRole('menu'); await expect(menu).toBeInTheDocument(); + await userEvent.click(a, { button: 0 }); + await tick(); + await expect(menu).not.toBeInTheDocument(); }, args: { to: '#test', |