Created first version of the time-based visits chart

This commit is contained in:
Alejandro Celaya
2020-05-30 09:25:15 +02:00
parent c670d86955
commit 61867366e7
5 changed files with 98 additions and 12 deletions

View File

@@ -82,8 +82,9 @@ describe('<GraphCard />', () => {
wrapper = shallow(<GraphCard isBarChart title="The chart" stats={stats} highlightedStats={highlightedStats} />);
const horizontal = wrapper.find(HorizontalBar);
const { datasets: [{ data }, highlightedData ] } = horizontal.prop('data');
const { datasets: [{ data, label }, highlightedData ] } = horizontal.prop('data');
expect(label).toEqual(highlightedStats ? 'Non-selected' : 'Visits');
expect(data).toEqual(expectedData);
expectedHighlightedData && expect(highlightedData.data).toEqual(expectedHighlightedData);
!expectedHighlightedData && expect(highlightedData).toBeUndefined();