Skip to content

Commit

Permalink
test: 修复测试
Browse files Browse the repository at this point in the history
  • Loading branch information
lijinke666 committed Aug 5, 2022
1 parent 3af7230 commit 7f479de
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
6 changes: 4 additions & 2 deletions packages/s2-core/__tests__/unit/facet/pivot-facet-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import { Canvas, Group } from '@antv/g-canvas';
import { assembleDataCfg, assembleOptions } from 'tests/util';
import { size, get, find } from 'lodash';
import { DEFAULT_TREE_ROW_WIDTH } from './../../../src/common/constant/options';
import { getMockPivotMeta } from './util';
import type { PanelScrollGroup } from '@/group/panel-scroll-group';
import { SpreadSheet } from '@/sheet-type';
Expand Down Expand Up @@ -206,10 +207,11 @@ describe('Pivot Mode Facet Test', () => {

expect(rowsHierarchy.getLeaves()).toHaveLength(8);
expect(rowsHierarchy.getNodes()).toHaveLength(10);
expect(rowsHierarchy.width).toBe(width);
expect(rowsHierarchy.width).toBe(DEFAULT_TREE_ROW_WIDTH);
expect(width).toBeUndefined();

rowsHierarchy.getNodes().forEach((node, index) => {
expect(node.width).toBe(width);
expect(node.width).toBe(DEFAULT_TREE_ROW_WIDTH);
expect(node.height).toBe(
cellCfg.height +
rowCellStyle.padding?.top +
Expand Down
8 changes: 4 additions & 4 deletions packages/s2-react/playground/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ export const s2Options: S2Options = {
cellCfg: {
height: 50,
},
rowCfg: {
width: 300,
},
treeRowsWidth: 500,
// rowCfg: {
// width: 300,
// },
// treeRowsWidth: 500,
hierarchyCollapse: false,
},
};
Expand Down

0 comments on commit 7f479de

Please sign in to comment.