mirror of
https://github.com/misskey-dev/misskey
synced 2024-11-24 23:26:35 +09:00
build(#10336): add an interaction test for <MkA/>
This commit is contained in:
parent
356fd72603
commit
bc6d576a4e
@ -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>;
|
||||
|
@ -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',
|
||||
|
Loading…
Reference in New Issue
Block a user