From b0cda7a622d833608cd0fdf518a01f47983d7403 Mon Sep 17 00:00:00 2001 From: ThbPS Date: Fri, 16 Aug 2024 11:41:58 +0200 Subject: [PATCH] feat: UT for CTA icon --- packages/components/alert/test/alert.spec.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/packages/components/alert/test/alert.spec.ts b/packages/components/alert/test/alert.spec.ts index d2bdcb6f..70385d85 100644 --- a/packages/components/alert/test/alert.spec.ts +++ b/packages/components/alert/test/alert.spec.ts @@ -12,6 +12,10 @@ describe('Alert tests', () => { const findTitle = () => wrapper.find('.puik-alert__title') const findDesc = () => wrapper.find('.puik-alert__description') const findCloseButton = () => wrapper.find('.puik-alert__close') + const findButtonLeftIcon = () => + wrapper.find('.puik-alert__button .puik-button__left-icon') + const findButtonRightIcon = () => + wrapper.find('.puik-alert__button .puik-button__right-icon') const factory = ( propsData: Record = {}, @@ -47,6 +51,16 @@ describe('Alert tests', () => { expect(wrapper.emitted('click')).toBeTruthy() }) + it('should display a button left icon', () => { + factory({ buttonLabel: 'Button', buttonLeftIcon: 'open_in_new' }) + expect(findButtonLeftIcon().text()).toBe('open_in_new') + }) + + it('should display a button right icon', () => { + factory({ buttonLabel: 'Button', buttonRightIcon: 'open_in_new' }) + expect(findButtonRightIcon().text()).toBe('open_in_new') + }) + it('should display a title and a description', async () => { factory({ title: faker.lorem.word(2),