From 7519e6c446e27ed7896edc6d49c931a28f58fe50 Mon Sep 17 00:00:00 2001 From: acnormun Date: Fri, 6 Dec 2024 12:45:20 -0300 Subject: [PATCH] fix: add remove icon test --- .../airtime/currency/CurrencyElement.test.tsx | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/components/flow/routers/airtime/currency/CurrencyElement.test.tsx b/src/components/flow/routers/airtime/currency/CurrencyElement.test.tsx index 64c4e8ede..ccbd2d323 100644 --- a/src/components/flow/routers/airtime/currency/CurrencyElement.test.tsx +++ b/src/components/flow/routers/airtime/currency/CurrencyElement.test.tsx @@ -83,6 +83,21 @@ describe('CurrencyElement Component', () => { expect(removeIcon).toBeInTheDocument(); }); + it('doesn`t render remove icon when index is less than 0', () => { + const props = { + ...defaultProps, + index: -1, + }; + const { container } = render( + + + , + ); + + const removeIcon = container.querySelector(`div.${styles.remove}`); + expect(removeIcon).not.toBeInTheDocument(); + }); + it('calls onRemove when remove icon is clicked', () => { const { container } = render(