Skip to content
This repository was archived by the owner on Oct 13, 2022. It is now read-only.

Fixing Vue 2 + Vuetify project by adding custom mount command #88

Open
wants to merge 5 commits into
base: vue-cli-2-cypress-10-upgrade
Choose a base branch
from

Conversation

JessicaSachs
Copy link

@JessicaSachs JessicaSachs commented Jan 25, 2022

👋🏻 the solution for projects that have global plugins for Vue 2 is to create a wrapper component. You'll also notice that the usage of .vue() to get the emitted events is unnecessary and I would discourage that pattern in favor of using cy.spy().as('myFunctionAlias') and asserting the spy was called.

cy.mount(MyComponent, { listeners: { 'action-btn:clicked': cy.spy().as('onActionButtonClicked') } } )
  .get('button').click()
  .get('@onActionButtonClicked').should('have.been.called')

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants