Skip to content

Commit

Permalink
fix(box): box plot 单测修改
Browse files Browse the repository at this point in the history
  • Loading branch information
visiky committed Oct 12, 2021
1 parent b66e1cf commit f24364e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion __tests__/unit/plots/box/change-data-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,9 @@ describe('box change data', () => {
box.render();
const outliersView = box.chart.views.find((v) => v.id === OUTLIERS_VIEW_ID);

const len = outliersData.reduce((r, d) => r + d.outliers.length, 0);
expect(box.chart.geometries[0].elements.length).toEqual(outliersData.length);
expect(outliersView.geometries[0].elements.length).toEqual(outliersData.length);
expect(outliersView.geometries[0].elements.length).toEqual(len);

const newData = [
...outliersData,
Expand Down
5 changes: 3 additions & 2 deletions __tests__/unit/plots/box/outliers-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ describe('box outliers', () => {
// 类型
expect(geometry.type).toBe('point');
// 图形元素个数
expect(geometry.elements.length).toBe(outliersData.length);
const len = outliersData.reduce((r, d) => r + d.outliers.length, 0);
expect(geometry.elements.length).toBe(len);
// 同步y轴度量 axis sync
// @ts-ignore
expect(outliersScale.sync).toEqual(BOX_SYNC_NAME);
Expand Down Expand Up @@ -59,7 +60,7 @@ describe('box outliers', () => {
const elements = view.geometries[0].elements;

// 类型
expect(elements[0].shape.cfg.children[0].attr('fill')).toBe('#f6f');
expect(elements[0].shape.attr('fill')).toBe('#f6f');

box.destroy();
});
Expand Down

0 comments on commit f24364e

Please sign in to comment.