This repository was archived by the owner on May 16, 2024. It is now read-only.
generated from storybookjs/addon-kit
-
Notifications
You must be signed in to change notification settings - Fork 6
This repository was archived by the owner on May 16, 2024. It is now read-only.
[Bug] Property or method is not defined... / Invalid handler for event... #6
Copy link
Copy link
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
I have a story with some actions defined in argTypes:
argTypes: {
actionButtonText: {
control: 'text',
description: 'Text to render in actionButton. Requires actionButton true to be rendered'
},
clickAction: {
action: 'click:action',
table: { disable: true }
},
clickDismiss: {
action: 'click:dismiss',
table: { disable: true }
},
};
I also have those actions defined in my template:
<l-toast-content
v-bind="$props"
@click-dismiss="clickDismiss"
@click-action="clickAction"
/>
The click-dismiss and click-action are the emitted events from the component, and the clickDismiss and clickAction are those defined in the argTypes.
The issue is that when I run my unit testes using composeStories I got some warns in the terminal. They don't make the test fail, though I don't think that this is expected. The warns are:
[Vue warn]: Property or method "clickDismiss" is not defined on the instance but referenced during render. Make sure that this property is reactive, either in the data option, or for class-based components, by initializing the property. See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.
console.error node_modules/vue/dist/vue.common.dev.js:630
[Vue warn]: Property or method "clickAction" is not defined on the instance but referenced during render. Make sure that this property is reactive, either in the data option, or for class-based components, by initializing the property. See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.
console.error node_modules/vue/dist/vue.common.dev.js:630
[Vue warn]: Invalid handler for event "click-dismiss": got undefined
console.error node_modules/vue/dist/vue.common.dev.js:630
[Vue warn]: Invalid handler for event "click-action": got undefined
I think that It can be related to the way components are rendered from the stories.
Steps to reproduce the behavior
- Create component docs with actions as events
- Run a unit test of this component with composeStories
Expected behavior
It shouldn't show those warns.
Environment
- OS: Mint
- Node.js version: 12.9.0
- NPM version: 6.10.2
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working