Skip to content

Commit

Permalink
fix(table-sheet): 修复明细表排序后开启行列冻结, 冻结行展示错误 close #2388 (#2453)
Browse files Browse the repository at this point in the history
* fix(table-sheet): 修复明细表排序后开启行列冻结, 冻结行展示错误 close #2388

* test: 增加明细表 theme 测试

* test: 修复过滤条件单测
  • Loading branch information
lijinke666 authored Dec 7, 2023
1 parent 02f0b3b commit 741e27a
Show file tree
Hide file tree
Showing 13 changed files with 1,301 additions and 108 deletions.

Large diffs are not rendered by default.

10 changes: 8 additions & 2 deletions packages/s2-core/__tests__/spreadsheet/theme-spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable jest/expect-expect */
import { createPivotSheet } from 'tests/util/helpers';
import { createPivotSheet, createTableSheet } from 'tests/util/helpers';
import type { Group, IGroup, ShapeAttrs } from '@antv/g-canvas';
import { get } from 'lodash';
import type {
Expand Down Expand Up @@ -52,10 +52,16 @@ describe('SpreadSheet Theme Tests', () => {
CellTypes.MERGED_CELL,
];

test('should get default theme', () => {
test('should get pivot sheet default theme', () => {
expect(s2.theme).toMatchSnapshot();
});

test('should get table sheet theme', () => {
const tableSheet = createTableSheet(null);

expect(tableSheet.theme).toMatchSnapshot();
});

test.each(CELL_TYPES)(
"should assign the same color for %s's text and icon",
(cellType: CellTypes) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,17 @@
*/
import { assembleDataCfg } from 'tests/util';
import type { S2DataConfig } from '@/common/interface';
import { TableSheet } from '@/sheet-type';
import { SpreadSheet, TableSheet } from '@/sheet-type';
import { TableDataSet } from '@/data-set/table-data-set';

jest.mock('@/sheet-type');
jest.mock('@/facet/layout/node');
const MockTableSheet = TableSheet as any as jest.Mock<TableSheet>;

describe('Table Mode Dataset Test', () => {
let s2: SpreadSheet;
let dataSet: TableDataSet;

const mockNumberFormatter = jest.fn().mockReturnValue('number');
const mockSubTypeFormatter = jest.fn().mockReturnValue('sub_type');
const mockTypeFormatter = jest.fn().mockReturnValue('type');
Expand Down Expand Up @@ -56,9 +58,12 @@ describe('Table Mode Dataset Test', () => {
},
],
};

beforeEach(() => {
MockTableSheet.mockClear();
dataSet = new TableDataSet(new MockTableSheet());

s2 = new MockTableSheet();
dataSet = new TableDataSet(s2);

dataSet.setDataCfg(dataCfg);
});
Expand Down
Loading

1 comment on commit 741e27a

@vercel
Copy link

@vercel vercel bot commented on 741e27a Dec 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.