mirror of
https://github.com/apache/superset.git
synced 2026-07-13 18:25:58 +00:00
test(dashboard): cover combined edit+standalone URL params
Adds the React-side analogue of the legacy `?edit=true&standalone=true` Cypress mount, asserting the two URL params remain orthogonal: standalone=2 hides DashboardHeader while editMode still drives the `dashboard--editing` wrapper class. Satisfies sc-107447 task 3. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -181,6 +181,26 @@ describe('DashboardBuilder', () => {
|
||||
}
|
||||
});
|
||||
|
||||
test('should apply editing class and hide header when both edit and standalone params are set', () => {
|
||||
// Combined-params analogue of the legacy `?edit=true&standalone=true` Cypress
|
||||
// mount. The two URL params are orthogonal on the React side: standalone=2
|
||||
// suppresses DashboardHeader regardless of editMode, while editMode still
|
||||
// drives the `dashboard--editing` class on the wrapper.
|
||||
const originalHref = window.location.href;
|
||||
window.history.replaceState({}, '', '/?edit=true&standalone=2');
|
||||
try {
|
||||
const { getByTestId, queryByTestId } = setup({
|
||||
dashboardState: { ...mockState.dashboardState, editMode: true },
|
||||
});
|
||||
expect(getByTestId('dashboard-content-wrapper')).toHaveClass(
|
||||
'dashboard dashboard--editing',
|
||||
);
|
||||
expect(queryByTestId('dashboard-header-container')).not.toBeInTheDocument();
|
||||
} finally {
|
||||
window.history.replaceState({}, '', originalHref);
|
||||
}
|
||||
});
|
||||
|
||||
test('should render a Sticky top-level Tabs if the dashboard has tabs', async () => {
|
||||
const { findAllByTestId } = setup({
|
||||
dashboardLayout: undoableDashboardLayoutWithTabs,
|
||||
|
||||
Reference in New Issue
Block a user