Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
IanVS committed Sep 28, 2022
1 parent 374014c commit 651b735
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
10 changes: 3 additions & 7 deletions examples/vue2.6/stories/EnvironmentVariables.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,11 @@ export default {
component: EnvVars,
};

const Template = (args) => ({
const Template = (args, { argTypes }) => ({
// Components used in your story `template` are defined in the `components` object
components: { EnvVars },
// The story's `args` need to be mapped into the template through the `setup()` method
setup() {
return { args };
},
// And then the `args` are bound to your component with `v-bind="args"`
template: '<env-vars v-bind="args" />',
props: Object.keys(argTypes),
template: '<env-vars v-bind="$props" />',
});

export const Info = Template.bind({});
Expand Down
13 changes: 7 additions & 6 deletions examples/vue2.7/stories/Button.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,13 @@ Primary.args = {
primary: true,
label: 'Button',
};
Primary.play = async ({ args, canvasElement }) => {
const canvas = within(canvasElement);
const button = canvas.getByRole('button');
await userEvent.click(button);
await expect(args.onClick).toHaveBeenCalled();
};
// TODO: Interaction tests do not work in vue2 yet. See https://github.com/storybookjs/storybook/pull/19207
// Primary.play = async ({ args, canvasElement }) => {
// const canvas = within(canvasElement);
// const button = canvas.getByRole('button');
// await userEvent.click(button);
// await expect(args.onClick).toHaveBeenCalled();
// };

export const Secondary = Template.bind({});
Secondary.args = {
Expand Down

0 comments on commit 651b735

Please sign in to comment.