Skip to content

Commit b6f91d5

Browse files
committed
test: 修复测试
1 parent 28dc9ac commit b6f91d5

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

packages/s2-core/__tests__/spreadsheet/scroll-spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
/* eslint-disable jest/no-conditional-expect */
22
import * as mockDataConfig from 'tests/data/simple-data.json';
33
import { createMockCellInfo, getContainer, sleep } from 'tests/util/helpers';
4-
import { get } from 'lodash';
54
import { ScrollBar, ScrollType } from '../../src/ui/scrollbar';
65
import type { CellScrollPosition } from './../../src/common/interface/scroll';
76
import { PivotSheet, SpreadSheet } from '@/sheet-type';
@@ -457,7 +456,8 @@ describe('Scroll Tests', () => {
457456
s2.changeSheetSize(200, 200); // 显示横/竖滚动条
458457
s2.render(false);
459458

460-
const scrollBar = get(s2.facet, name) as ScrollBar;
459+
// @ts-ignore
460+
const scrollBar = s2.facet[name] as ScrollBar;
461461
expect(scrollBar.thumbShape.getBBox()[key]).toStrictEqual(
462462
scrollBar.thumbLen,
463463
);

packages/s2-core/src/cell/base-cell.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,8 @@ export abstract class BaseCell<T extends SimpleBBox> extends Group {
371371
const isStateShape = this.stateShapes.has(shapeName);
372372
const shape = isStateShape
373373
? this.stateShapes.get(shapeName)
374-
: get(this, shapeName);
374+
: // @ts-ignore
375+
this[shapeName];
375376

376377
// stateShape 默认 visible 为 false
377378
if (isStateShape && !shape.get('visible')) {

packages/s2-core/src/cell/table-corner-cell.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { TableColCell } from './table-col-cell';
33

44
export class TableCornerCell extends TableColCell {
55
public getStyle(name?: string) {
6-
return name ? get(this.theme, name) : get(this.theme, 'cornerCell');
6+
return name ? get(this.theme, name) : this.theme?.cornerCell;
77
}
88

99
protected showSortIcon() {

0 commit comments

Comments
 (0)