Skip to content

Commit

Permalink
#17 Test for HeatMap component
Browse files Browse the repository at this point in the history
  • Loading branch information
blms committed Dec 29, 2020
1 parent 56372f3 commit f778e49
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/components/HeatMap/HeatMap.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/**
* @jest-environment jsdom
*/

import { render } from '@testing-library/react';
import HeatMap from './HeatMap';
import { DocumentFiltersContext, DocumentAnnotationsContext } from '../../contexts/DocumentContext';

test('renders heatmap', async () => {
const { getByTestId } = render(
<DocumentAnnotationsContext.Provider
value={[[], jest.fn(), jest.fn(), jest.fn()]}
>
<DocumentFiltersContext.Provider value={[[], jest.fn()]}>
<HeatMap
pdf={false}
/>
</DocumentFiltersContext.Provider>
</DocumentAnnotationsContext.Provider>,
);
const heatMap = getByTestId('heat-map');
expect(heatMap).toBeInTheDocument();
});

0 comments on commit f778e49

Please sign in to comment.