test(explore): add end-to-end regression test for DatasourcePanel through the real AutoSizer + react-window List pipeline - #43023
Conversation
…ough the real AutoSizer + react-window List pipeline Adds a test that exercises the real (unmocked) react-virtualized-auto-sizer and react-window List/DatasourcePanelItem together, unlike the existing suite which mocks AutoSizer to a fixed height and never engages react-window's own sizing path. Guards against regressions like apache#43008.
Code Review Agent Run #e527cdActionable 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 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #43023 +/- ##
==========================================
- Coverage 66.59% 66.59% -0.01%
==========================================
Files 2863 2863
Lines 161716 161716
Branches 37258 37258
==========================================
- Hits 107698 107689 -9
- Misses 51974 51982 +8
- Partials 2044 2045 +1
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:
|
There was a problem hiding this comment.
Pull request overview
Adds a frontend regression test to exercise the Explore DatasourcePanel through the real react-virtualized-auto-sizer + react-window v2 List sizing/measurement path (via a ResizeObserver callback), covering the regression reported in #43008.
Changes:
- Introduces a new Jest/RTL test that renders
DatasourcePanelinsideExploreContainerwithout mockingAutoSizer. - Stubs
window.ResizeObserverto simulate browser resize notifications and provide deterministic sizing. - Asserts that representative metrics and columns render (guarding against blank/empty panel regressions).
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Drop `implements ResizeObserver` on the fake observer (matches the plain-class stub pattern used elsewhere in the repo, e.g. AnnotationLayer.test.tsx) and fix a stale comment referencing "the rest of this test file" mocking AutoSizer when this file is standalone. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
✅ Deploy Preview for superset-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Code Review Agent Run #8afb08Actionable 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
Investigated #43008 (metrics/columns not showing in the Explore Datasource
Panel, bisected to the react-window v1->v2 bump in #42528).
Dosu's automated diagnosis on that issue claims
DatasourceItems.tsxandDatasourcePanelItem.tsxare still using the old v1VariableSizeListAPI.That's not accurate against current
master-- both files were correctlymigrated to react-window v2's
List/rowHeight/rowCount/rowProps/rowComponentAPI in the same commit the bisect flagged, and haven'tchanged since.
I couldn't reproduce the blank-panel bug in code:
List+AutoSizerwiring pattern, using the pinnedreact-window@2.3.0and
react-virtualized-auto-sizer@1.0.26versions, renders rowscorrectly.
master, butit mocks
react-virtualized-auto-sizerto a fixed height, which bypassesreact-window's own sizing path entirely and wouldn't catch a regression
here.
This PR adds a test that exercises the real (unmocked)
AutoSizer+ realList+ realDatasourcePanelItemend to end, driving an actualResizeObservercallback the way the browser does. It renders metrics andcolumns correctly against the current code. I verified the test actually
catches breakage by temporarily zeroing out
rowCountinDatasourceItems.tsxand confirming the test fails.No code fix is included since I couldn't find a bug to fix -- this adds
permanent regression coverage for the one gap in this area's existing test
suite either way.
BEFORE/AFTER
N/A -- test-only change, no behavior change.
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION