Skip to content

Commit

Permalink
fix: add remove icon test
Browse files Browse the repository at this point in the history
  • Loading branch information
acnormun committed Dec 6, 2024
1 parent f9fed27 commit 7519e6c
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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(
<Provider store={store}>
<CurrencyElement {...props} />
</Provider>,
);

const removeIcon = container.querySelector(`div.${styles.remove}`);
expect(removeIcon).not.toBeInTheDocument();
});

it('calls onRemove when remove icon is clicked', () => {
const { container } = render(
<Provider store={store}>
Expand Down

0 comments on commit 7519e6c

Please sign in to comment.