Skip to content

Commit

Permalink
fix: 修复合并 master 的 copy 相关单测
Browse files Browse the repository at this point in the history
  • Loading branch information
stone-lyl committed Feb 21, 2023
1 parent abf5e68 commit 8587137
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions packages/s2-core/__tests__/unit/utils/export/copy-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -250,13 +250,23 @@ describe('List Table Core Data Process', () => {
.filter(({ cellType }) => cellType === CellTypes.DATA_CELL);

s2.interaction.changeState({
cells: [getCellMeta(cells[0]), getCellMeta(cells[29])],
cells: [getCellMeta(cells[21]), getCellMeta(cells[48])],
stateName: InteractionStateName.SELECTED,
});

const data = getSelectedData(s2);
const dataContent = getCopyPlainContent(s2);

expect(data.length).toBe(37);
expect(dataContent).toMatchInlineSnapshot(`
"浙江省
宁波市"
`);
});

it('should copy correct data with data filtered', () => {
Expand Down Expand Up @@ -387,13 +397,13 @@ describe('List Table Core Data Process', () => {

const cell = sss.interaction
.getAllCells()
.filter(({ cellType }) => cellType === CellTypes.DATA_CELL)[20];
.filter(({ cellType }) => cellType === CellTypes.DATA_CELL)[40];

sss.interaction.changeState({
cells: [getCellMeta(cell)],
stateName: InteractionStateName.SELECTED,
});
const data = getSelectedData(sss);
const data = getCopyPlainContent(sss);

expect(data).toBe(convertString(newLineText));
});
Expand Down

0 comments on commit 8587137

Please sign in to comment.