0

Hi I'm new to cypress and trying to make test for vue js <router-link>. Following is the example

About.vue

<router-link data-cy="contactViewLink" :to="{name: 'ContactView'}">Click here</router-link>

About.cy.js

it('Then: User click on Contact View link', () => {

      // Do assertions
      cy.get('[data-cy="contactViewLink"]').click()

      cy.get('@routerPushStub').should('have.been.calledWith', {
        name: 'ContactView'
      })
    })
mukul soni
  • 135
  • 2
  • 7

0 Answers0