pleroma/app/soapbox/components/ui/emoji/__tests__/emoji.test.tsx
marcin mikołajczak 785c6b57e3 RTL support, use Stack and HStack in more places
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2022-11-25 18:04:11 +01:00

23 lines
705 B
TypeScript

import React from 'react';
import { render, screen } from '../../../../jest/test-helpers';
import Emoji from '../emoji';
describe('<Emoji />', () => {
it('renders a simple emoji', () => {
render(<Emoji emoji='😀' />);
const img = screen.getByRole('img');
expect(img.getAttribute('src')).toBe('/packs/emoji/1f600.svg');
expect(img.getAttribute('alt')).toBe('😀');
});
// https://emojipedia.org/emoji-flag-sequence/
it('renders a sequence emoji', () => {
render(<Emoji emoji='🇺🇸' />);
const img = screen.getByRole('img');
expect(img.getAttribute('src')).toBe('/packs/emoji/1f1fa-1f1f8.svg');
expect(img.getAttribute('alt')).toBe('🇺🇸');
});
});