Skip to content

Commit

Permalink
✅ Fix testing issues
Browse files Browse the repository at this point in the history
  • Loading branch information
dej611 committed Jul 17, 2020
1 parent 7da7714 commit 82b5e5c
Show file tree
Hide file tree
Showing 5 changed files with 1,401 additions and 751 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -217,30 +217,26 @@ describe('Point Series Config Type Class Test Suite', function () {
});

describe('line chart', function () {
function prepareData(percentileTestdata) {
function prepareData({ cfg, data }) {
const percentileDataObj = {
get: (prop) => {
return maxBucketData[prop] || maxBucketData.data[prop] || null;
},
getLabels: () => [],
data: percentileTestdata.data,
data: data,
};
return (parsedConfig = vislibPointSeriesTypes.line(
percentileTestdata.cfg,
percentileDataObj
));
const parsedConfig = vislibPointSeriesTypes.line(cfg, percentileDataObj);
return parsedConfig;
}

it('should render a percentile line chart', function () {
const parsedConfig = prepareData(percentileTestdata);
expect(JSON.stringify(parsedConfig)).toEqual(JSON.stringify(percentileTestdataResult));
expect(parsedConfig).toMatchObject(percentileTestdataResult);
});

it('should render a percentile line chart when value is float', function () {
const parsedConfig = prepareData(percentileTestdataFloatValue);
expect(JSON.stringify(parsedConfig)).toEqual(
JSON.stringify(percentileTestdataFloatValueResult)
);
expect(parsedConfig).toMatchObject(percentileTestdataFloatValueResult);
});
});
});
Loading

0 comments on commit 82b5e5c

Please sign in to comment.