From ea5f13163da224def322082ed49710b9f7599d64 Mon Sep 17 00:00:00 2001 From: rafieltq Date: Fri, 20 Oct 2023 07:28:30 -0400 Subject: [PATCH] listProduct edit button tests --- tests/components/Products/ListProduct.test.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/tests/components/Products/ListProduct.test.js b/tests/components/Products/ListProduct.test.js index ff0aa21..50868c9 100644 --- a/tests/components/Products/ListProduct.test.js +++ b/tests/components/Products/ListProduct.test.js @@ -40,7 +40,7 @@ const wrapperFactory = () => mount(ListProduct, { }, loadingFavorite: false, currency: { - symbol: 'R$', + symbol: 'R$', } } }) @@ -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() + }) + }) \ No newline at end of file