Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(table-sheet): 修复明细表排序后开启行列冻结, 冻结行展示错误 close #2388 #2453

Merged
merged 5 commits into from
Dec 7, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

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
Loading