Skip to content

Commit

Permalink
Implement failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
RasmusKjeldgaard committed Nov 28, 2024
1 parent 978ff6e commit cc199b4
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions libs/designsystem/dropdown/src/dropdown.component.stories.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { type Meta, moduleMetadata, type StoryObj } from '@storybook/angular';
import { userEvent, within } from '@storybook/test';

import { DropdownComponent, DropdownModule } from '@kirbydesign/designsystem/dropdown';

import { DropdownExampleModule } from '~/app/examples/dropdown-example/dropdown-example.module';
Expand Down Expand Up @@ -68,4 +70,26 @@ export const CookbookExample: Story = {
render: () => ({
template: `<cookbook-dropdown-example></cookbook-dropdown-example>`,
}),
play: async ({ canvasElement }) => {
const canvas = within(canvasElement);

const dropdown = canvas.getByRole('button', {
name: 'Dropdown with plain text',
});

await userEvent.click(dropdown);
},
};

export const CookbookExampleWithActions: Story = {
...CookbookExample,
play: async ({ canvasElement }) => {
const canvas = within(canvasElement);

const dropdownBtn = canvas.getByRole('button', {
name: 'Dropdown with plain text',
});

await userEvent.click(dropdownBtn);
},
};

0 comments on commit cc199b4

Please sign in to comment.