Skip to content

Commit

Permalink
increase coverage
Browse files Browse the repository at this point in the history
Signed-off-by: Adam Setch <adam.setch@outlook.com>
  • Loading branch information
setchy committed Aug 9, 2024
1 parent b063679 commit 83cfac9
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/components/icons/Emoji.test.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { render } from '@testing-library/react';
import { Errors } from '../../utils/constants';
import { Emoji, type IEmoji } from './Emoji';

describe('components/icons/Emoji.tsx', () => {
Expand All @@ -11,10 +12,13 @@ describe('components/icons/Emoji.tsx', () => {
});

it('should render - offline SVGs', () => {
const props: IEmoji = {
emoji: '🛜',
};
const tree = render(<Emoji {...props} />);
expect(tree).toMatchSnapshot();
const offlineEmojis = Errors.NETWORK.emojis;

// Check that all NETWORK error emojis are configured for offline use
for (const emoji of offlineEmojis) {
const tree = render(<Emoji emoji={emoji} />);
expect(tree.baseElement.innerHTML).not.toContain('https://'); // Offline emojis should not have an online URL
expect(tree).toMatchSnapshot();
}
});
});

0 comments on commit 83cfac9

Please sign in to comment.