Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
yannbf committed Jan 23, 2024
1 parent b1a2d70 commit e97b6b7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion code/renderers/vue3/src/__tests__/Button.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const props = withDefaults(
/**
* Whether the button is disabled
*/
disabled: boolean;
disabled?: boolean;
/**
* primary or secondary button
*/
Expand Down
8 changes: 4 additions & 4 deletions code/renderers/vue3/src/__tests__/composeStories.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ it('reuses args from composed story', () => {
expect(buttonElement.textContent).toEqual(Secondary.args.label);
});

it('onclick handler is called', async () => {
const onClickSpy = vi.fn();
render(Secondary({ onClick: onClickSpy }));
it('myClickEvent handler is called', async () => {
const myClickEventSpy = vi.fn();
render(Secondary({ onMyClickEvent: myClickEventSpy }));
const buttonElement = screen.getByRole('button');
buttonElement.click();
expect(onClickSpy).toHaveBeenCalled();
expect(myClickEventSpy).toHaveBeenCalled();
});

it('reuses args from composeStories', () => {
Expand Down

0 comments on commit e97b6b7

Please sign in to comment.