Merge branch 'improve-test-coverage-for-trends' into 'develop'
Improve Trends test coverage See merge request soapbox-pub/soapbox-fe!1416
This commit is contained in:
commit
b3d2306aaf
2 changed files with 8 additions and 2 deletions
|
@ -42,7 +42,7 @@ const Hashtag: React.FC<IHashtag> = ({ hashtag }) => {
|
||||||
</Stack>
|
</Stack>
|
||||||
|
|
||||||
{hashtag.get('history') && (
|
{hashtag.get('history') && (
|
||||||
<div className='w-[40px]'>
|
<div className='w-[40px]' data-testid='sparklines'>
|
||||||
<Sparklines
|
<Sparklines
|
||||||
width={40}
|
width={40}
|
||||||
height={28}
|
height={28}
|
||||||
|
|
|
@ -10,13 +10,19 @@ describe('<TrendsPanel />', () => {
|
||||||
trends: ImmutableMap({
|
trends: ImmutableMap({
|
||||||
items: fromJS([{
|
items: fromJS([{
|
||||||
name: 'hashtag 1',
|
name: 'hashtag 1',
|
||||||
history: [{ accounts: [] }],
|
history: [{
|
||||||
|
day: '1652745600',
|
||||||
|
uses: '294',
|
||||||
|
accounts: '180',
|
||||||
|
}],
|
||||||
}]),
|
}]),
|
||||||
}),
|
}),
|
||||||
};
|
};
|
||||||
|
|
||||||
render(<TrendsPanel limit={1} />, null, store);
|
render(<TrendsPanel limit={1} />, null, store);
|
||||||
expect(screen.getByTestId('hashtag')).toHaveTextContent(/hashtag 1/i);
|
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', () => {
|
it('renders multiple trends', () => {
|
||||||
|
|
Loading…
Reference in a new issue