Extracted paginator used in SortableBarGraph to its own component

This commit is contained in:
Alejandro Celaya
2019-09-21 18:29:58 +02:00
parent 99475fc311
commit 7bbff114a4
3 changed files with 38 additions and 24 deletions

View File

@@ -49,12 +49,10 @@ describe('<SortableBarGraph />', () => {
assert = (sortName, sortDir, expectedKeys, expectedValues, done) => {
dropdown.prop('onChange')(sortName, sortDir);
setImmediate(() => {
const graphCard = wrapper.find(GraphCard);
const statsKeys = keys(graphCard.prop('stats'));
const statsValues = values(graphCard.prop('stats'));
const stats = wrapper.find(GraphCard).prop('stats');
expect(statsKeys).toEqual(expectedKeys);
expect(statsValues).toEqual(expectedValues);
expect(keys(stats)).toEqual(expectedKeys);
expect(values(stats)).toEqual(expectedValues);
done();
});
};
@@ -80,10 +78,9 @@ describe('<SortableBarGraph />', () => {
assert = (itemsPerPage, expectedStats, done) => {
dropdown.prop('setValue')(itemsPerPage);
setImmediate(() => {
const graphCard = wrapper.find(GraphCard);
const statsKeys = keys(graphCard.prop('stats'));
const stats = wrapper.find(GraphCard).prop('stats');
expect(statsKeys).toEqual(expectedStats);
expect(keys(stats)).toEqual(expectedStats);
done();
});
};