Skip to content

Commit 2094774

Browse files
Fix/vue3 xstate test issues (#1267)
* fix: set default for optional cypress options * fix: added provide value to storybook
1 parent 5e1c221 commit 2094774

4 files changed

Lines changed: 14 additions & 11 deletions

File tree

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1+
import { app } from '@storybook/vue3';
2+
3+
app.provide('query', 'from Storybook!');
4+
15
export const parameters = {
2-
actions: { argTypesRegex: "^on[A-Z].*" },
3-
controls: {
4-
matchers: {
5-
color: /(background|color)$/i,
6-
date: /Date$/,
7-
},
8-
},
9-
}
6+
actions: { argTypesRegex: '^on[A-Z].*' },
7+
controls: {
8+
matchers: {
9+
color: /(background|color)$/i,
10+
date: /Date$/,
11+
},
12+
},
13+
};

starters/vue3-xstate-css/cypress/support/component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ declare global {
2828
}
2929
}
3030

31-
Cypress.Commands.add('mount', (component, options) => {
31+
Cypress.Commands.add('mount', (component, options = {}) => {
3232
options.global = options.global || {};
3333
options.global.provide = options.global.provide || {};
3434
return mount(component, options);

starters/vue3-xstate-css/src/stories/GreetView.stories.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,3 @@ const Template = (args) => ({
1717
});
1818

1919
export const Default = Template.bind({});
20-
Default.args = { query: 'from Storybook!' };

starters/vue3-xstate-css/src/tests/GreetView.cy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import GreetView from '../views/GreetView.vue';
22

33
describe('<GreetView />', () => {
44
it('renders', () => {
5-
cy.mount(GreetView, {});
5+
cy.mount(GreetView);
66
});
77

88
it('should display a message with my greeting when I pass in a greeting', () => {

0 commit comments

Comments
 (0)