Skip to content

Commit

Permalink
test(VDataTable): fix failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
KaelWD committed Apr 6, 2023
1 parent b7eb055 commit bcfe98f
Showing 1 changed file with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,10 @@ describe('VDataTable', () => {
})

it('should not emit click:row event when clicking select or expand', () => {
const onClick = cy.stub()
cy.mount(() => (
<Application>
<VDataTable showSelect showExpand items={ DESSERT_ITEMS } headers={ DESSERT_HEADERS } />
<VDataTable showSelect showExpand items={ DESSERT_ITEMS } headers={ DESSERT_HEADERS } onClick:row={ onClick } />
</Application>
))

Expand All @@ -167,15 +168,15 @@ describe('VDataTable', () => {
.eq(3)
.find('.v-btn')
.click()

cy.emitted(VDataTable, 'click:row')
.should('not.exist')
.then(() => {
expect(onClick).not.to.be.called
})

cy.get('tbody tr')
.eq(1)
.click()

cy.emitted(VDataTable, 'click:row')
.should('have.length', 1)
.then(() => {
expect(onClick).to.be.calledOnce
})
})
})

0 comments on commit bcfe98f

Please sign in to comment.