diff --git a/app/component-library/components/Banners/Banner/Banner.test.tsx b/app/component-library/components/Banners/Banner/Banner.test.tsx index 59791526ede..dfe4ba01b69 100644 --- a/app/component-library/components/Banners/Banner/Banner.test.tsx +++ b/app/component-library/components/Banners/Banner/Banner.test.tsx @@ -24,7 +24,7 @@ describe('Banner', () => { expect(wrapper).toMatchSnapshot(); }); - it('should render correctly with a start accessory', () => { + it('should render correctly with a start accessory', async () => { const wrapper = render( { description={ 'This is nothing but a test of the emergency broadcast system.' } - startAccessory={Start accessory} + startAccessory={Test Start accessory} />, ); + expect(wrapper).toMatchSnapshot(); + expect(await wrapper.findByText('Test Start accessory')).toBeDefined(); }); - it('should render correctly with an action button', () => { + it('should render correctly with an action button', async () => { const wrapper = render( { 'This is nothing but a test of the emergency broadcast system.' } actionButtonProps={{ - label: 'Action Button', + label: 'Test Action Button', onPress: () => jest.fn(), variant: ButtonVariants.Secondary, }} />, ); + expect(wrapper).toMatchSnapshot(); + expect(await wrapper.findByText('Test Action Button')).toBeDefined(); }); - it('should render correctly with a close button', () => { + it('should render correctly with a close button', async () => { const wrapper = render( { 'This is nothing but a test of the emergency broadcast system.' } actionButtonProps={{ - label: 'Action Button', + label: 'Test Action Button', onPress: () => jest.fn(), variant: ButtonVariants.Secondary, }} @@ -80,6 +84,9 @@ describe('Banner', () => { }} />, ); + expect(wrapper).toMatchSnapshot(); + expect(await wrapper.findByText('Test Action Button')).toBeDefined(); + expect(await wrapper.queryByTestId('banner-close-button')).toBeDefined(); }); }); diff --git a/app/component-library/components/Banners/Banner/__snapshots__/Banner.test.tsx.snap b/app/component-library/components/Banners/Banner/__snapshots__/Banner.test.tsx.snap index 85c2b882d45..d75b95588ab 100644 --- a/app/component-library/components/Banners/Banner/__snapshots__/Banner.test.tsx.snap +++ b/app/component-library/components/Banners/Banner/__snapshots__/Banner.test.tsx.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`SendFlowAddressFrom should render correctly 1`] = ` +exports[`Banner should render correctly 1`] = ` `; -exports[`SendFlowAddressFrom should render correctly with a close button 1`] = ` +exports[`Banner should render correctly with a close button 1`] = ` - Action Button + Test Action Button @@ -193,6 +193,7 @@ exports[`SendFlowAddressFrom should render correctly with a close button 1`] = ` `; -exports[`SendFlowAddressFrom should render correctly with a start accessory 1`] = ` +exports[`Banner should render correctly with a start accessory 1`] = ` - Start accessory + Test Start accessory `; -exports[`SendFlowAddressFrom should render correctly with an action button 1`] = ` +exports[`Banner should render correctly with an action button 1`] = ` - Action Button + Test Action Button diff --git a/app/component-library/components/Banners/Banner/foundation/BannerBase/BannerBase.tsx b/app/component-library/components/Banners/Banner/foundation/BannerBase/BannerBase.tsx index 2cb273ceb35..1ef8282098d 100644 --- a/app/component-library/components/Banners/Banner/foundation/BannerBase/BannerBase.tsx +++ b/app/component-library/components/Banners/Banner/foundation/BannerBase/BannerBase.tsx @@ -69,6 +69,7 @@ const BannerBase: React.FC = ({ {(onClose || closeButtonProps) && (