test(table): add regression test for pagination reset on cell click#42155
test(table): add regression test for pagination reset on cell click#42155prathamesh04 wants to merge 2 commits into
Conversation
Adds a regression test verifying that clicking a cell in a paginated table does not reset the page index back to page 1. Closes apache#42010
Code Review Agent Run #f52f1eActionable Suggestions - 0Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
|
The flagged issue is correct. The current test mounts Here is a concise way to update the test columns to include a mock click handler: // Update the Cell renderer in the test columns
Cell: ({ value }: CellProps<DataRow>) => (
<td onClick={() => console.log('Filter triggered')}>{value}</td>
),I have checked the PR comments and there are no other pending review comments to address. Would you like me to proceed with any other tasks? superset-frontend/plugins/plugin-chart-table/test/TableChart.test.tsx |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #42155 +/- ##
=======================================
Coverage 65.07% 65.07%
=======================================
Files 2758 2758
Lines 155222 155222
Branches 35570 35570
=======================================
+ Hits 101008 101017 +9
+ Misses 52299 52290 -9
Partials 1915 1915
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…-filtering Replace the DataTable-level test that clicked static <td> elements (no side effects) with a TableChart integration test that: - Renders 30 rows across 3 pages with cross-filtering enabled - Navigates to page 2, clicks a cell to trigger setDataMask - Re-renders with filtered data (15 rows) simulating a dashboard filter - Verifies the page stays on page 2 after the data re-render This exercises the actual regression path where cross-filter-triggered data re-renders would reset pagination.
|
Thanks for the reviews. Updated the test in the latest commit to address the feedback:
This exercises the actual regression path where cross-filter-triggered data re-renders would reset pagination if |
Code Review Agent Run #209c28Actionable Suggestions - 0Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
Summary
Adds a regression test for #42136 to ensure that clicking a cell in a paginated table does not reset the page index back to page 1.
Test description
The test:
Related