fix(subdirectory): retire /superset/welcome/ dead route in FileHandler
Closes C4 from the PR #39925 deep review: five `history.push('/superset/welcome/')`
emitters in `src/pages/FileHandler/index.tsx` (browser-unsupported,
no-files-provided, unsupported-file-type, getFile() error, modal-close) hit
404 after the `Superset.route_base = ""` cleanup landed in the prior wave —
the `/welcome/` route exists at the unprefixed path, and subdir deployments
get the basename via the app's URL-composition layer rather than via emitters.
Changes (single slice — same-commit coupling: any subset flips at least one
invariant red, verified by red-against-HEAD oracle):
- `src/pages/FileHandler/index.tsx` — all five emitters now push `/welcome/`.
- `src/pages/FileHandler/index.test.tsx` — five `mockHistoryPush`
assertions track the new value.
- `src/pages/FileHandler/FileHandler.subdirectory.test.tsx` — new module:
real `<Router>` + `createMemoryHistory` (no `useHistory` mock) exercises
the live react-router pathway across both deployment shapes (5 scenarios
× 2 entry paths = 10 cases), asserting post-push `location.pathname ===
'/welcome/'`. Comment explains why basename composition isn't tested at
this layer (history@5.3.0 + react-router-dom@5.3.4 silently drop the
`basename` prop; composition lives in `applicationRoot()` callers).
- `src/utils/navigationUtils.invariants.test.ts` — drop
`'src/pages/FileHandler/index.tsx'` from the L2
`HARDCODED_SUPERSET_LITERAL_ALLOWLIST` (15 → 14 entries); the
stale-allow-list scan now enforces the migration.
Oracle (pre-edit, verified this session, both reverted):
- Allowlist-only delete → primary scan red at FileHandler:62/68/95/106/118.
- Emitter-only convert → five `mockHistoryPush` assertions red.
Tests: 20 FileHandler tests green (10 existing + 10 new regression);
9 L2 invariants green; 414 `src/utils/` tests green.
Pre-commit: prettier, oxlint, custom-rules, type-check all pass.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> J
Joe Li committed
fbd07afdc968a30c59653cb0c47d7b2980301c15
Parent: 9141324