Skip to content

Commit efbb1d8

Browse files
Jon Karlsenlmiller1990emilyrohrbough
authored
[ DOCS ] Vue component testing/events (#4953)
Co-authored-by: Lachlan Miller <lachlan.miller.1990@outlook.com> Co-authored-by: Emily Rohrbough <emilyrohrbough@users.noreply.github.com>
1 parent 39106c4 commit efbb1d8

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

docs/guides/component-testing/vue/quickstart.mdx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -376,8 +376,10 @@ it('clicking + fires a change event with the incremented value', () => {
376376
First, we create a new spy by calling the `cy.spy()` method. We pass in a string
377377
that gives the spy an [alias](/guides/core-concepts/variables-and-aliases),
378378
which assigns the spy a name by which we can reference it later. In
379-
`cy.mount()`, we initialize the component and pass the spy into it. After that,
380-
we click the increment button.
379+
`cy.mount()`, we initialize the component and pass the spy into it (note that
380+
while the event is defined as `change`, the spy is passed for the prop
381+
`onChange`; this is due to the fact that Vue compiles `emit('change')` to
382+
`props.onChange()`). After that, we click the increment button.
381383

382384
The next line is a bit different. We've seen how we can use the `cy.get()`
383385
method to select elements, but we can also use it to grab any aliases we've set

0 commit comments

Comments
 (0)