diff --git a/packages/s2-core/__tests__/spreadsheet/__snapshots__/corner-spec.ts.snap b/packages/s2-core/__tests__/spreadsheet/__snapshots__/corner-spec.ts.snap index e579c9e4a7..785a1b7999 100644 --- a/packages/s2-core/__tests__/spreadsheet/__snapshots__/corner-spec.ts.snap +++ b/packages/s2-core/__tests__/spreadsheet/__snapshots__/corner-spec.ts.snap @@ -11,7 +11,7 @@ Array [ "field": "province", "height": 30, "hierarchy": undefined, - "id": "province", + "id": "", "inCollapseNode": undefined, "isCollapsed": undefined, "isGrandTotals": undefined, @@ -29,7 +29,7 @@ Array [ "seriesNumberWidth": undefined, "spreadsheet": Anything, "value": "province", - "width": 99, + "width": 99.33, "x": 0, "y": 0, }, @@ -42,7 +42,7 @@ Array [ "field": "city", "height": 30, "hierarchy": undefined, - "id": "city", + "id": "", "inCollapseNode": undefined, "isCollapsed": undefined, "isGrandTotals": undefined, @@ -60,8 +60,8 @@ Array [ "seriesNumberWidth": undefined, "spreadsheet": Anything, "value": "city", - "width": 99, - "x": 99, + "width": 99.33, + "x": 99.33, "y": 0, }, ] @@ -78,7 +78,7 @@ Array [ "field": "", "height": 30, "hierarchy": undefined, - + "id": "", "inCollapseNode": undefined, "isCollapsed": undefined, "isGrandTotals": undefined, @@ -109,7 +109,7 @@ Array [ "field": "province", "height": 30, "hierarchy": undefined, - "id": "province", + "id": "", "inCollapseNode": undefined, "isCollapsed": undefined, "isGrandTotals": undefined, @@ -140,8 +140,7 @@ Array [ "field": "city", "height": 30, "hierarchy": undefined, - - "id": "city", + "id": "", "inCollapseNode": undefined, "isCollapsed": undefined, "isGrandTotals": undefined, @@ -177,8 +176,7 @@ Array [ "field": "", "height": 30, "hierarchy": undefined, - - "id": "province/city/数值", + "id": "", "inCollapseNode": undefined, "isCollapsed": undefined, "isGrandTotals": undefined, @@ -196,8 +194,7 @@ Array [ "seriesNumberWidth": 0, "spreadsheet": Anything, "value": "province/city/数值", - "width": 145, - "width": 151, + "width": 145.36, "x": 0, "y": 0, }, @@ -215,7 +212,7 @@ Array [ "field": "", "height": 30, "hierarchy": undefined, - + "id": "", "inCollapseNode": undefined, "isCollapsed": undefined, "isGrandTotals": undefined, @@ -246,8 +243,7 @@ Array [ "field": "", "height": 30, "hierarchy": undefined, - - "id": "province/city/数值", + "id": "", "inCollapseNode": undefined, "isCollapsed": undefined, "isGrandTotals": undefined, @@ -265,8 +261,7 @@ Array [ "seriesNumberWidth": 80, "spreadsheet": Anything, "value": "province/city/数值", - "width": 145, - "width": 151, + "width": 145.36, "x": 80, "y": 0, }, @@ -284,8 +279,7 @@ Array [ "field": "province", "height": 30, "hierarchy": undefined, - - "id": "province", + "id": "", "inCollapseNode": undefined, "isCollapsed": undefined, "isGrandTotals": undefined, @@ -316,8 +310,7 @@ Array [ "field": "city", "height": 30, "hierarchy": undefined, - - "id": "city", + "id": "", "inCollapseNode": undefined, "isCollapsed": undefined, "isGrandTotals": undefined, @@ -353,7 +346,7 @@ Array [ "field": "", "height": 30, "hierarchy": undefined, - + "id": "", "inCollapseNode": undefined, "isCollapsed": undefined, "isGrandTotals": undefined, @@ -384,8 +377,7 @@ Array [ "field": "province", "height": 30, "hierarchy": undefined, - - "id": "province", + "id": "", "inCollapseNode": undefined, "isCollapsed": undefined, "isGrandTotals": undefined, @@ -416,8 +408,7 @@ Array [ "field": "city", "height": 30, "hierarchy": undefined, - - "id": "city", + "id": "", "inCollapseNode": undefined, "isCollapsed": undefined, "isGrandTotals": undefined, @@ -453,8 +444,7 @@ Array [ "field": "", "height": 30, "hierarchy": undefined, - - "id": "province/city", + "id": "", "inCollapseNode": undefined, "isCollapsed": undefined, "isGrandTotals": undefined, @@ -473,7 +463,6 @@ Array [ "spreadsheet": Anything, "value": "province/city", "width": 120, - "width": 123, "x": 0, "y": 0, }, @@ -491,7 +480,7 @@ Array [ "field": "", "height": 30, "hierarchy": undefined, - + "id": "", "inCollapseNode": undefined, "isCollapsed": undefined, "isGrandTotals": undefined, @@ -522,8 +511,7 @@ Array [ "field": "", "height": 30, "hierarchy": undefined, - - "id": "province/city", + "id": "", "inCollapseNode": undefined, "isCollapsed": undefined, "isGrandTotals": undefined, @@ -542,7 +530,6 @@ Array [ "spreadsheet": Anything, "value": "province/city", "width": 120, - "width": 123, "x": 80, "y": 0, }, @@ -560,8 +547,7 @@ Array [ "field": "province", "height": 30, "hierarchy": undefined, - - "id": "province", + "id": "", "inCollapseNode": undefined, "isCollapsed": undefined, "isGrandTotals": undefined, @@ -579,7 +565,7 @@ Array [ "seriesNumberWidth": undefined, "spreadsheet": Anything, "value": "province", - "width": 99, + "width": 99.33, "x": 0, "y": 0, }, @@ -592,8 +578,7 @@ Array [ "field": "city", "height": 30, "hierarchy": undefined, - - "id": "city", + "id": "", "inCollapseNode": undefined, "isCollapsed": undefined, "isGrandTotals": undefined, @@ -611,8 +596,8 @@ Array [ "seriesNumberWidth": undefined, "spreadsheet": Anything, "value": "city", - "width": 99, - "x": 99, + "width": 99.33, + "x": 99.33, "y": 0, }, ] @@ -629,7 +614,7 @@ Array [ "field": "", "height": 30, "hierarchy": undefined, - + "id": "", "inCollapseNode": undefined, "isCollapsed": undefined, "isGrandTotals": undefined, @@ -660,8 +645,7 @@ Array [ "field": "province", "height": 30, "hierarchy": undefined, - - "id": "province", + "id": "", "inCollapseNode": undefined, "isCollapsed": undefined, "isGrandTotals": undefined, @@ -692,8 +676,7 @@ Array [ "field": "city", "height": 30, "hierarchy": undefined, - - "id": "city", + "id": "", "inCollapseNode": undefined, "isCollapsed": undefined, "isGrandTotals": undefined, @@ -729,8 +712,7 @@ Array [ "field": "", "height": 30, "hierarchy": undefined, - - "id": "province/city", + "id": "", "inCollapseNode": undefined, "isCollapsed": undefined, "isGrandTotals": undefined, @@ -749,7 +731,6 @@ Array [ "spreadsheet": Anything, "value": "province/city", "width": 120, - "width": 123, "x": 0, "y": 0, }, @@ -767,7 +748,7 @@ Array [ "field": "", "height": 30, "hierarchy": undefined, - + "id": "", "inCollapseNode": undefined, "isCollapsed": undefined, "isGrandTotals": undefined, @@ -798,8 +779,7 @@ Array [ "field": "", "height": 30, "hierarchy": undefined, - - "id": "province/city", + "id": "", "inCollapseNode": undefined, "isCollapsed": undefined, "isGrandTotals": undefined, @@ -818,7 +798,6 @@ Array [ "spreadsheet": Anything, "value": "province/city", "width": 120, - "width": 123, "x": 80, "y": 0, }, diff --git a/packages/s2-core/__tests__/spreadsheet/__snapshots__/custom-cell-style-spec.ts.snap b/packages/s2-core/__tests__/spreadsheet/__snapshots__/custom-cell-style-spec.ts.snap index 2baf34699e..14478ee83c 100644 --- a/packages/s2-core/__tests__/spreadsheet/__snapshots__/custom-cell-style-spec.ts.snap +++ b/packages/s2-core/__tests__/spreadsheet/__snapshots__/custom-cell-style-spec.ts.snap @@ -45,17 +45,17 @@ Array [ Object { "height": 30, "id": "root[&]笔", - "width": 300, + "width": 299, }, Object { "height": 30, "id": "root[&]笔[&]price", - "width": 150, + "width": 149.5, }, Object { "height": 30, "id": "root[&]笔[&]cost", - "width": 150, + "width": 149.5, }, ] `; @@ -65,17 +65,17 @@ Array [ Object { "height": 60, "id": "root[&]浙江", - "width": 149, + "width": 149.5, }, Object { "height": 30, "id": "root[&]浙江[&]义乌", - "width": 149, + "width": 149.5, }, Object { "height": 30, "id": "root[&]浙江[&]杭州", - "width": 149, + "width": 149.5, }, ] `; @@ -140,7 +140,7 @@ Array [ Object { "height": 66, "id": "root[&]浙江", - "width": 149, + "width": 149.5, }, Object { "height": 33, @@ -160,17 +160,17 @@ Array [ Object { "height": 330, "id": "root[&]浙江", - "width": 149, + "width": 149.5, }, Object { "height": 30, "id": "root[&]浙江[&]义乌", - "width": 149, + "width": 149.5, }, Object { "height": 300, "id": "root[&]浙江[&]杭州", - "width": 149, + "width": 149.5, }, ] `; @@ -180,17 +180,17 @@ Array [ Object { "height": 60, "id": "root[&]浙江", - "width": 149, + "width": 149.5, }, Object { "height": 30, "id": "root[&]浙江[&]义乌", - "width": 149, + "width": 149.5, }, Object { "height": 30, "id": "root[&]浙江[&]杭州", - "width": 149, + "width": 149.5, }, ] `; @@ -200,17 +200,17 @@ Array [ Object { "height": 30, "id": "root[&]笔", - "width": 300, + "width": 299, }, Object { "height": 30, "id": "root[&]笔[&]price", - "width": 150, + "width": 149.5, }, Object { "height": 30, "id": "root[&]笔[&]cost", - "width": 150, + "width": 149.5, }, ] `; @@ -220,22 +220,22 @@ Array [ Object { "height": 30, "id": "root[&]浙江[&]义乌-root[&]笔[&]price", - "width": 150, + "width": 149.5, }, Object { "height": 30, "id": "root[&]浙江[&]杭州-root[&]笔[&]price", - "width": 150, + "width": 149.5, }, Object { "height": 30, "id": "root[&]浙江[&]义乌-root[&]笔[&]cost", - "width": 150, + "width": 149.5, }, Object { "height": 30, "id": "root[&]浙江[&]杭州-root[&]笔[&]cost", - "width": 150, + "width": 149.5, }, ] `; @@ -247,12 +247,12 @@ Array [ Object { "height": 30, "id": "root[&]类别", - "width": 299, + "width": 299.5, }, Object { "height": 30, "id": "root[&]子类别", - "width": 299, + "width": 299.5, }, ] `; @@ -262,132 +262,132 @@ Array [ Object { "height": 30, "id": "0-root[&]类别", - "width": 299, + "width": 299.5, }, Object { "height": 30, "id": "1-root[&]类别", - "width": 299, + "width": 299.5, }, Object { "height": 30, "id": "2-root[&]类别", - "width": 299, + "width": 299.5, }, Object { "height": 30, "id": "3-root[&]类别", - "width": 299, + "width": 299.5, }, Object { "height": 30, "id": "4-root[&]类别", - "width": 299, + "width": 299.5, }, Object { "height": 30, "id": "5-root[&]类别", - "width": 299, + "width": 299.5, }, Object { "height": 30, "id": "6-root[&]类别", - "width": 299, + "width": 299.5, }, Object { "height": 30, "id": "7-root[&]类别", - "width": 299, + "width": 299.5, }, Object { "height": 30, "id": "8-root[&]类别", - "width": 299, + "width": 299.5, }, Object { "height": 30, "id": "9-root[&]类别", - "width": 299, + "width": 299.5, }, Object { "height": 30, "id": "10-root[&]类别", - "width": 299, + "width": 299.5, }, Object { "height": 30, "id": "11-root[&]类别", - "width": 299, + "width": 299.5, }, Object { "height": 30, "id": "12-root[&]类别", - "width": 299, + "width": 299.5, }, Object { "height": 30, "id": "0-root[&]子类别", - "width": 299, + "width": 299.5, }, Object { "height": 30, "id": "1-root[&]子类别", - "width": 299, + "width": 299.5, }, Object { "height": 30, "id": "2-root[&]子类别", - "width": 299, + "width": 299.5, }, Object { "height": 30, "id": "3-root[&]子类别", - "width": 299, + "width": 299.5, }, Object { "height": 30, "id": "4-root[&]子类别", - "width": 299, + "width": 299.5, }, Object { "height": 30, "id": "5-root[&]子类别", - "width": 299, + "width": 299.5, }, Object { "height": 30, "id": "6-root[&]子类别", - "width": 299, + "width": 299.5, }, Object { "height": 30, "id": "7-root[&]子类别", - "width": 299, + "width": 299.5, }, Object { "height": 30, "id": "8-root[&]子类别", - "width": 299, + "width": 299.5, }, Object { "height": 30, "id": "9-root[&]子类别", - "width": 299, + "width": 299.5, }, Object { "height": 30, "id": "10-root[&]子类别", - "width": 299, + "width": 299.5, }, Object { "height": 30, "id": "11-root[&]子类别", - "width": 299, + "width": 299.5, }, Object { "height": 30, "id": "12-root[&]子类别", - "width": 299, + "width": 299.5, }, ] `; @@ -427,7 +427,7 @@ Array [ Object { "height": 60, "id": "root[&]类型", - "width": 119, + "width": 119.8, }, Object { "height": 30, @@ -482,72 +482,72 @@ Array [ Object { "height": 60, "id": "0-root[&]类别", - "width": 299, + "width": 299.5, }, Object { "height": 60, "id": "1-root[&]类别", - "width": 299, + "width": 299.5, }, Object { "height": 60, "id": "2-root[&]类别", - "width": 299, + "width": 299.5, }, Object { "height": 60, "id": "3-root[&]类别", - "width": 299, + "width": 299.5, }, Object { "height": 60, "id": "4-root[&]类别", - "width": 299, + "width": 299.5, }, Object { "height": 60, "id": "5-root[&]类别", - "width": 299, + "width": 299.5, }, Object { "height": 60, "id": "6-root[&]类别", - "width": 299, + "width": 299.5, }, Object { "height": 60, "id": "0-root[&]子类别", - "width": 299, + "width": 299.5, }, Object { "height": 60, "id": "1-root[&]子类别", - "width": 299, + "width": 299.5, }, Object { "height": 60, "id": "2-root[&]子类别", - "width": 299, + "width": 299.5, }, Object { "height": 60, "id": "3-root[&]子类别", - "width": 299, + "width": 299.5, }, Object { "height": 60, "id": "4-root[&]子类别", - "width": 299, + "width": 299.5, }, Object { "height": 60, "id": "5-root[&]子类别", - "width": 299, + "width": 299.5, }, Object { "height": 60, "id": "6-root[&]子类别", - "width": 299, + "width": 299.5, }, ] `; @@ -557,102 +557,102 @@ Array [ Object { "height": 40, "id": "0-root[&]类别", - "width": 299, + "width": 299.5, }, Object { "height": 30, "id": "1-root[&]类别", - "width": 299, + "width": 299.5, }, Object { "height": 100, "id": "2-root[&]类别", - "width": 299, + "width": 299.5, }, Object { "height": 30, "id": "3-root[&]类别", - "width": 299, + "width": 299.5, }, Object { "height": 30, "id": "4-root[&]类别", - "width": 299, + "width": 299.5, }, Object { "height": 30, "id": "5-root[&]类别", - "width": 299, + "width": 299.5, }, Object { "height": 30, "id": "6-root[&]类别", - "width": 299, + "width": 299.5, }, Object { "height": 30, "id": "7-root[&]类别", - "width": 299, + "width": 299.5, }, Object { "height": 30, "id": "8-root[&]类别", - "width": 299, + "width": 299.5, }, Object { "height": 30, "id": "9-root[&]类别", - "width": 299, + "width": 299.5, }, Object { "height": 40, "id": "0-root[&]子类别", - "width": 299, + "width": 299.5, }, Object { "height": 30, "id": "1-root[&]子类别", - "width": 299, + "width": 299.5, }, Object { "height": 100, "id": "2-root[&]子类别", - "width": 299, + "width": 299.5, }, Object { "height": 30, "id": "3-root[&]子类别", - "width": 299, + "width": 299.5, }, Object { "height": 30, "id": "4-root[&]子类别", - "width": 299, + "width": 299.5, }, Object { "height": 30, "id": "5-root[&]子类别", - "width": 299, + "width": 299.5, }, Object { "height": 30, "id": "6-root[&]子类别", - "width": 299, + "width": 299.5, }, Object { "height": 30, "id": "7-root[&]子类别", - "width": 299, + "width": 299.5, }, Object { "height": 30, "id": "8-root[&]子类别", - "width": 299, + "width": 299.5, }, Object { "height": 30, "id": "9-root[&]子类别", - "width": 299, + "width": 299.5, }, ] `; diff --git a/packages/s2-core/__tests__/spreadsheet/__snapshots__/custom-table-col-spec.ts.snap b/packages/s2-core/__tests__/spreadsheet/__snapshots__/custom-table-col-spec.ts.snap index e607dd4387..e7310e8255 100644 --- a/packages/s2-core/__tests__/spreadsheet/__snapshots__/custom-table-col-spec.ts.snap +++ b/packages/s2-core/__tests__/spreadsheet/__snapshots__/custom-table-col-spec.ts.snap @@ -169,43 +169,43 @@ Array [ "description": undefined, "height": 30, "value": "地区", - "width": 238, + "width": 239.6, }, Object { "description": undefined, "height": 30, "value": "省份", - "width": 119, + "width": 119.8, }, Object { "description": undefined, "height": 30, "value": "城市", - "width": 119, + "width": 119.8, }, Object { "description": undefined, "height": 60, "value": "类型", - "width": 119, + "width": 119.8, }, Object { "description": undefined, "height": 30, "value": "金额", - "width": 238, + "width": 239.6, }, Object { "description": "价格描述", "height": 30, "value": "价格", - "width": 119, + "width": 119.8, }, Object { "description": undefined, "height": 30, "value": "数量", - "width": 119, + "width": 119.8, }, ] `; @@ -216,37 +216,37 @@ Array [ "description": "a-1 描述", "height": 30, "value": "自定义节点 a-1", - "width": 447, + "width": 449.25, }, Object { "description": "a-1-1 描述", "height": 30, "value": "自定义节点 a-1-1", - "width": 298, + "width": 299.5, }, Object { "description": "指标1描述", "height": 30, "value": "指标1", - "width": 149, + "width": 149.75, }, Object { "description": "指标2描述", "height": 30, "value": "指标2", - "width": 149, + "width": 149.75, }, Object { "description": "a-1-2 描述", "height": 60, "value": "自定义节点 a-1-2", - "width": 149, + "width": 149.75, }, Object { "description": "a-2 描述", "height": 90, "value": "自定义节点 a-2", - "width": 149, + "width": 149.75, }, ] `; diff --git a/packages/s2-core/__tests__/spreadsheet/scroll-spec.ts b/packages/s2-core/__tests__/spreadsheet/scroll-spec.ts index e3f2591ee7..42cf96faea 100644 --- a/packages/s2-core/__tests__/spreadsheet/scroll-spec.ts +++ b/packages/s2-core/__tests__/spreadsheet/scroll-spec.ts @@ -471,7 +471,7 @@ describe('Scroll Tests', () => { s2.changeSheetSize(1000, 150); // 纵向滚动条 await s2.render(false); - expect(s2.facet.vScrollBar.getBBox().x).toBe(195); + expect(s2.facet.vScrollBar.getBBox().x).toBeCloseTo(195); s2.setOptions({ interaction: { diff --git a/packages/s2-core/__tests__/unit/data-process/pivot-spec.tsx b/packages/s2-core/__tests__/unit/data-process/pivot-spec.tsx index 394bd0a7c4..443de482a4 100644 --- a/packages/s2-core/__tests__/unit/data-process/pivot-spec.tsx +++ b/packages/s2-core/__tests__/unit/data-process/pivot-spec.tsx @@ -58,41 +58,50 @@ describe('Pivot Table Core Data Process', () => { data.length, ); + // 左上角 expect(get(indexesData, [prefix, 1, 1, 1, 1, 1])).toEqual({ province: '浙江省', city: '杭州市', type: '家具', sub_type: '桌子', number: 7789, - }); // 左上角 + }); + + // 右上角 expect(get(indexesData, [prefix, 1, 1, 2, 2, 1])).toEqual({ province: '浙江省', city: '杭州市', type: '办公用品', sub_type: '纸张', number: 1343, - }); // 右上角 + }); + + // 左下角 expect(get(indexesData, [prefix, 2, 4, 1, 1, 1])).toEqual({ province: '四川省', city: '乐山市', type: '家具', sub_type: '桌子', number: 2330, - }); // 左下角 + }); + + // 右下角 expect(get(indexesData, [prefix, 2, 4, 2, 2, 1])).toEqual({ province: '四川省', city: '乐山市', type: '办公用品', sub_type: '纸张', number: 352, - }); // 右下角 + }); + + // 中间 expect(get(indexesData, [prefix, 1, 4, 2, 1, 1])).toEqual({ province: '浙江省', city: '舟山市', type: '办公用品', sub_type: '笔', number: 1432, - }); // 中间 + }); }); }); @@ -142,6 +151,7 @@ describe('Pivot Table Core Data Process', () => { '南充市', '乐山市', ]); + // 父子关系正确 const leavesNodes = rowsHierarchy.getLeaves(); const firstLeafNode = leavesNodes[0]; @@ -168,26 +178,26 @@ describe('Pivot Table Core Data Process', () => { // 节点正确 expect(colsHierarchy.getIndexNodes()).toHaveLength(4); - expect(colsHierarchy.getNodes()).toHaveLength(10); // 价格在列头 家具[&]桌子[&]number + expect(colsHierarchy.getNodes()).toHaveLength(10); // 价格在列头 家具[&]桌子[&]数量 // 叶子节点正确 expect(colsHierarchy.getLeaves().map((node) => node.value)).toEqual([ - 'number', - 'number', - 'number', - 'number', + '数量', + '数量', + '数量', + '数量', ]); // 层级正确 expect(colsHierarchy.getNodes().map((node) => node.value)).toEqual([ '家具', '桌子', - 'number', + '数量', '沙发', - 'number', + '数量', '办公用品', '笔', - 'number', + '数量', '纸张', - 'number', + '数量', ]); expect(colsHierarchy.getNodes(0).map((node) => node.value)).toEqual([ '家具', @@ -200,16 +210,17 @@ describe('Pivot Table Core Data Process', () => { '纸张', ]); expect(colsHierarchy.getNodes(2).map((node) => node.value)).toEqual([ - 'number', - 'number', - 'number', - 'number', + '数量', + '数量', + '数量', + '数量', ]); + // 父子关系正确 const leavesNodes = colsHierarchy.getLeaves(); const firstLeafNode = leavesNodes[0]; - expect(firstLeafNode.value).toEqual('number'); + expect(firstLeafNode.value).toEqual('数量'); expect(firstLeafNode.parent!.value).toEqual('桌子'); expect(firstLeafNode.parent!.parent?.value).toEqual('家具'); expect( @@ -217,7 +228,7 @@ describe('Pivot Table Core Data Process', () => { ).toEqual(['桌子', '沙发']); const lastLeafNode = leavesNodes[leavesNodes.length - 1]; - expect(lastLeafNode.value).toEqual('number'); + expect(lastLeafNode.value).toEqual('数量'); expect(lastLeafNode.parent!.value).toEqual('纸张'); expect(lastLeafNode.parent!.parent?.value).toEqual('办公用品'); expect( diff --git a/packages/s2-core/__tests__/unit/facet/pivot-facet-spec.ts b/packages/s2-core/__tests__/unit/facet/pivot-facet-spec.ts index 57f15ff4ee..a7261cb998 100644 --- a/packages/s2-core/__tests__/unit/facet/pivot-facet-spec.ts +++ b/packages/s2-core/__tests__/unit/facet/pivot-facet-spec.ts @@ -169,7 +169,7 @@ describe('Pivot Mode Facet Test', () => { expect(rowsHierarchy.getNodes(0)).toHaveLength(2); rowsHierarchy.getLeaves().forEach((node, index) => { - expect(node.width).toBe(99); + expect(node.width).toBeCloseTo(99); expect(node.height).toBe(dataCell!.height!); expect(node.x).toBe(99 * node.level); expect(node.y).toBe(node.height * index); @@ -195,7 +195,7 @@ describe('Pivot Mode Facet Test', () => { expect(colsHierarchy.getNodes(0)).toHaveLength(2); colsHierarchy.getLeaves().forEach((node, index) => { - expect(node.width).toBe(width); + expect(node.width).toBeCloseTo(width); expect(node.height).toBe(colCell!.height); expect(node.x).toBe(width * index); expect(node.y).toBe(node.height * node.level);