sadpandajoe opened a new pull request, #40782:
URL: https://github.com/apache/superset/pull/40782

   ### SUMMARY
   Adds React Testing Library coverage for the horizontal filter bar's layout, 
overflow, and orientation routing — behavior that was previously only covered 
by a disabled Cypress spec. Part of the ongoing Cypress → RTL/Playwright 
migration.
   
   Three test files are touched:
   
   - **`HorizontalFilterBar.test.tsx`** — 3 new cases covering the 
default-actions slot, all-filters rendering, and the empty-state message 
flipping off when `filterValues` is non-empty.
   - **`FilterControls/FilterControls.overflow.test.tsx`** (new) — 5 cases that 
drive overflow behavior by mocking the 
`@superset-ui/core/components/DropdownContainer` subpath and invoking 
`onOverflowingStateChange` directly: items pass-through, no-overflow (trigger 
count 0), overflow with active filter values (trigger count reflects active 
values), overflow with no active values (trigger 0 but content rendered), and 
all 12 overflowed filters reachable in `dropdownContent`.
   - **`FilterBar.test.tsx`** — 2 cases asserting that 
`FilterBarOrientation.Horizontal` mounts `Horizontal.tsx` (settings gear 
present, vertical heading absent) and `FilterBarOrientation.Vertical` mounts 
the vertical control.
   
   ### Implementation notes
   
   - `DropdownContainer` uses `react-resize-detector`, which reports width 0 in 
jsdom. Driving the real overflow math is unstable, so the overflow tests mock 
the `DropdownContainer` subpath (not the `@superset-ui/core/components` barrel 
— the barrel mock triggers a circular re-export chain via 
`LabeledErrorBoundInput` / `ActionButton`).
   - Reload-persistence of orientation is integration-level (server-side 
`json_metadata`, not localStorage) and is not RTL-testable; it remains out of 
scope for this change.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   N/A — test-only change.
   
   ### TESTING INSTRUCTIONS
   \`\`\`bash
   cd superset-frontend
   npx jest \\
     src/dashboard/components/nativeFilters/FilterBar/FilterBar.test.tsx \\
     
src/dashboard/components/nativeFilters/FilterBar/HorizontalFilterBar.test.tsx \\
     
src/dashboard/components/nativeFilters/FilterBar/FilterControls/FilterControls.test.tsx
 \\
     
src/dashboard/components/nativeFilters/FilterBar/FilterControls/FilterControls.overflow.test.tsx
   \`\`\`
   Expected: 49 passing tests across the four files.
   
   ### ADDITIONAL INFORMATION
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration (follow approval process in 
[SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] Migration is atomic, supports rollback & is backwards-compatible
     - [ ] Confirm DB migration upgrade and downgrade tested
     - [ ] Runtime estimates and downtime expectations provided
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to