Files
superset2/superset-frontend/plugins/plugin-chart-table/test
Claude 421252b343 fix(tests): update test mocks for jsdom 30 window.location and CSS changes
jsdom 30 (shipped with jest-environment-jsdom 30) makes window.location
non-configurable, breaking the Object.defineProperty and delete patterns
used across 19 test files.  Also introduces stricter CSS normalization
(rgba(x,y,z,1) -> rgb(x,y,z), alpha precision rounding, named colors to
rgb()) and stricter CSS font-shorthand parsing on SVG nodes.

Changes:
- Replace every Object.defineProperty(window, 'location', ...) and
  delete window.location; window.location = ... with
  jest.spyOn(window, 'location', 'get').mockReturnValue(...) plus
  .mockRestore() for cleanup
- Use getter/setter objects on the mock return value for tests that write
  to window.location.href or window.location.protocol
- Replace jest.spyOn(window, 'window', 'get') (also broken in jsdom 30)
  with jest.spyOn(window, 'location', 'get') in getDashboardUrl tests
- TableChart: rgba(172,225,196,1) -> rgb(172,225,196);
  rgba(172,225,196,0.812) -> rgba(172,225,196,0.81)
- DropdownContainer: 'background-color: red' -> 'background-color: rgb(255, 0, 0)'
- updateTextNode: fix CSS font shorthand order from
  'italic 30px Lobster 700' (invalid) to 'italic 700 30px Lobster' (valid)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-18 08:19:24 -07:00
..