Skip to content
Snippets Groups Projects
Unverified Commit bc6d576a authored by Acid Chicken (硫酸鶏)'s avatar Acid Chicken (硫酸鶏)
Browse files

build(#10336): add an interaction test for `<MkA/>`

parent 356fd726
No related branches found
No related tags found
No related merge requests found
......@@ -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',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment