Improve Trends test coverage

merge-requests/1416/head
Justin 2022-05-17 12:47:32 -04:00
rodzic 57465bbaff
commit 330bf8e74d
2 zmienionych plików z 8 dodań i 2 usunięć

Wyświetl plik

@ -42,7 +42,7 @@ const Hashtag: React.FC<IHashtag> = ({ hashtag }) => {
</Stack>
{hashtag.get('history') && (
<div className='w-[40px]'>
<div className='w-[40px]' data-testid='sparklines'>
<Sparklines
width={40}
height={28}

Wyświetl plik

@ -10,13 +10,19 @@ describe('<TrendsPanel />', () => {
trends: ImmutableMap({
items: fromJS([{
name: 'hashtag 1',
history: [{ accounts: [] }],
history: [{
day: '1652745600',
uses: '294',
accounts: '180',
}],
}]),
}),
};
render(<TrendsPanel limit={1} />, null, store);
expect(screen.getByTestId('hashtag')).toHaveTextContent(/hashtag 1/i);
expect(screen.getByTestId('hashtag')).toHaveTextContent(/180 people talking/i);
expect(screen.getByTestId('sparklines')).toBeInTheDocument();
});
it('renders multiple trends', () => {