forked from mirror/misskey
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>',
|
template: '<MkA v-bind="props">Text</MkA>',
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
args: {
|
|
||||||
to: '#test',
|
|
||||||
},
|
|
||||||
parameters: {
|
|
||||||
layout: 'centered',
|
|
||||||
},
|
|
||||||
} satisfies StoryObj<typeof MkA>;
|
|
||||||
export const ContextMenu = {
|
|
||||||
...Default,
|
|
||||||
async play({ canvasElement }) {
|
async play({ canvasElement }) {
|
||||||
const canvas = within(canvasElement);
|
const canvas = within(canvasElement);
|
||||||
const a = canvas.getByRole<HTMLAnchorElement>('link');
|
const a = canvas.getByRole<HTMLAnchorElement>('link');
|
||||||
@ -42,5 +33,14 @@ export const ContextMenu = {
|
|||||||
await tick();
|
await tick();
|
||||||
const menu = canvas.getByRole('menu');
|
const menu = canvas.getByRole('menu');
|
||||||
await expect(menu).toBeInTheDocument();
|
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>;
|
} satisfies StoryObj<typeof MkA>;
|
||||||
|
@ -41,6 +41,9 @@ export const Default = {
|
|||||||
await tick();
|
await tick();
|
||||||
const menu = canvas.getByRole('menu');
|
const menu = canvas.getByRole('menu');
|
||||||
await expect(menu).toBeInTheDocument();
|
await expect(menu).toBeInTheDocument();
|
||||||
|
await userEvent.click(a, { button: 0 });
|
||||||
|
await tick();
|
||||||
|
await expect(menu).not.toBeInTheDocument();
|
||||||
},
|
},
|
||||||
args: {
|
args: {
|
||||||
to: '#test',
|
to: '#test',
|
||||||
|
Loading…
Reference in New Issue
Block a user