Skip to content

Commit

Permalink
listProduct edit button tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rafieltq committed Oct 20, 2023
1 parent 0512881 commit ea5f131
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion tests/components/Products/ListProduct.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const wrapperFactory = () => mount(ListProduct, {
},
loadingFavorite: false,
currency: {
symbol: 'R$',
symbol: 'R$',
}
}
})
Expand Down Expand Up @@ -72,5 +72,16 @@ describe('List Product Component', () => {
expect(wrapper.props().currency).toBeTruthy()
expect(wrapper.props().currency.symbol).toBe('R$')
})

it('should be emit on-edit event', async () => {
await wrapper.find('.edit').trigger('click')
expect(wrapper.emitted('on-edit')).toBeTruthy()
})

it('should be emit view-details event', async () => {
await wrapper.find('span').trigger('click')
expect(wrapper.emitted('view-details')).toBeTruthy()
})


})

0 comments on commit ea5f131

Please sign in to comment.