sadpandajoe opened a new pull request, #40914:
URL: https://github.com/apache/superset/pull/40914
### SUMMARY
Migrates the dashboard standalone-mode scenario from the deleted Cypress
spec `cypress-base/cypress/e2e/dashboard/_skip.load.test.ts` (removed in
#40384) to a component-level RTL test in `DashboardBuilder.test.tsx`. Part of
the Cypress→Playwright/RTL migration epic.
The original Cypress spec opened `?edit=true&standalone=true` and asserted
three things. Two are already covered by existing unit tests; the new RTL test
covers the third:
| Original assertion | Where covered |
|---|---|
| `?edit=true` → `discard-changes-button` visible | URL→state in
`extractUrlParams.test.ts`; state→DOM in `Header.test.tsx` (`should render the
"Discard changes" button` under `editMode: true`). |
| `?standalone=true` → `#app-menu` not in DOM | `#app-menu` lives in Flask's
`spa.html` and is gated server-side by `{% if standalone_mode %}` — out of
RTL's reach. The React-side equivalent is `?standalone=2`
(`DashboardStandaloneMode.HideNavAndTitle`), which makes `DashboardBuilder`
suppress `<DashboardHeader />`. **Net-new RTL test added.** |
| Log emission (originally skipped as flaky) | Already covered by
`logger.test.ts` (`should POST an event to /superset/log/ when called`). |
The literal `?standalone=true` parses to `1` (`HideNav`), which only hides
the Flask-rendered app menu. Using `standalone=2` documents the closest
React-level contract and is called out in the test's comment.
### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
N/A — test-only change.
### TESTING INSTRUCTIONS
\`\`\`bash
cd superset-frontend
npm run test --
src/dashboard/components/DashboardBuilder/DashboardBuilder.test.tsx
\`\`\`
All 25 tests should pass, including the new one:
- \`should hide DashboardHeader when standalone mode hides nav and title
(?standalone=2)\`
### 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]