-
Notifications
You must be signed in to change notification settings - Fork 194
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: 明细表表头宽度拖拽条位置出错 bug close #2588 #2593
base: master
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
你好 @wangjinqing111,感谢你的贡献, 为了让代码更健壮, 请补充相应单元测试, 如果有 API 改动, 请修改 相应的文档 Hello, @wangjinqing111, Thanks for your contribution. In order to make the code more robust, please add the corresponding unit tests, and update the docs if there are API changes. |
感谢贡献, 请增加相应的单测,可以写在 packages/s2-core/tests/spreadsheet/table-resize-spec.ts 这里面, 断言一下热区的坐标 调试可以参考: https://s2.antv.antgroup.com/manual/contribution#%E8%B0%83%E8%AF%95%E5%8D%95%E6%B5%8B |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2593 +/- ##
==========================================
+ Coverage 76.48% 77.62% +1.14%
==========================================
Files 240 249 +9
Lines 12312 11992 -320
Branches 2630 2364 -266
==========================================
- Hits 9417 9309 -108
+ Misses 1377 1183 -194
+ Partials 1518 1500 -18 ☔ View full report in Codecov by Sentry. |
@@ -34,4 +38,72 @@ describe('Table Sheet Resize Test', () => { | |||
|
|||
expect(resizeGroup.getChildren().length).toBeGreaterThan(0); | |||
}); | |||
|
|||
test('is the size area located correctly in col cell When freezing the first column', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
两个单测基本相同, 看起来只有 frozenColCount
和 frozenTrailingColCount
区别, 可以使用 test.each
避免编写重复代码. 参考:
S2/packages/s2-core/__tests__/unit/interaction/base-interaction/click/row-column-click-spec.ts
Lines 129 to 154 in 25bc5b4
test.each([S2Event.ROW_CELL_CLICK, S2Event.COL_CELL_CLICK])( | |
'should selected cell when %s cell clicked', | |
(event) => { | |
const selected = jest.fn(); | |
s2.on(S2Event.GLOBAL_SELECTED, selected); | |
const isSelectedCellSpy = jest | |
.spyOn(s2.interaction, 'isSelectedCell') | |
.mockImplementation(() => false); | |
s2.emit(event, { | |
stopPropagation() {}, | |
} as unknown as GEvent); | |
expect(s2.interaction.getState()).toEqual({ | |
cells: [mockCellMeta], | |
nodes: [], | |
stateName: InteractionStateName.SELECTED, | |
}); | |
expect(s2.showTooltipWithInfo).toHaveBeenCalled(); | |
expect(selected).toHaveBeenCalled(); | |
expect(s2.interaction.hasIntercepts([InterceptType.HOVER])).toBeTrue(); | |
isSelectedCellSpy.mockRestore(); | |
}, | |
); |
s2.destroy(); | ||
}); | ||
|
||
test('is the size area located correctly in col cell When freezing the last column', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When => when ?
@@ -45,7 +45,11 @@ export class TableColCell extends ColCell { | |||
return isTopLevelNode(node); | |||
}, | |||
); | |||
const { colIndex } = getNodeRoot(this.meta); | |||
// const { colIndex } = getNodeRoot(this.meta); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
注释去掉
你的截图看起来是 Windows, 这个是设置环境变量
|
ping @wangjinqing111 |
这个问题单独修复 #2600 |
👀 PR includes
✨ Feature
🎨 Enhance
🐛 Bugfix
🔧 Chore
📝 Description
🖼️ Screenshot
🔗 Related issue link
🔍 Self-Check before the merge