mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Dashboards: Fix scroll position not being restored when leaving panel edit (#83787)
* Dashboards: Fix scroll position not being restored when leaving panel edit view * remove mock from tests * remove console log * Remove my debugging stuff, and don't render grid if width is 0 * remove old comment (but retain old, probably unneeded css) * rename ref * fix it not actually working anymore!!! * add e2e tests * jsonnet, i guess
This commit is contained in:
33
e2e/dashboards-suite/general-dashboards.spec.ts
Normal file
33
e2e/dashboards-suite/general-dashboards.spec.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
import { e2e } from '../utils';
|
||||
|
||||
const PAGE_UNDER_TEST = 'edediimbjhdz4b/a-tall-dashboard';
|
||||
|
||||
describe('Dashboards', () => {
|
||||
beforeEach(() => {
|
||||
e2e.flows.login(Cypress.env('USERNAME'), Cypress.env('PASSWORD'));
|
||||
});
|
||||
|
||||
it('should restore scroll position', () => {
|
||||
e2e.flows.openDashboard({ uid: PAGE_UNDER_TEST });
|
||||
e2e.components.Panels.Panel.title('Panel #1').should('be.visible');
|
||||
|
||||
// scroll to the bottom
|
||||
e2e.pages.Dashboard.DashNav.navV2()
|
||||
.parent()
|
||||
.parent() // Note, this will probably fail when we change the custom scrollbars
|
||||
.scrollTo('bottom', {
|
||||
timeout: 5 * 1000,
|
||||
});
|
||||
|
||||
// The last panel should be visible...
|
||||
e2e.components.Panels.Panel.title('Panel #50').should('be.visible');
|
||||
|
||||
// Then we open and close the panel editor
|
||||
e2e.components.Panels.Panel.menu('Panel #50').click({ force: true }); // it only shows on hover
|
||||
e2e.components.Panels.Panel.menuItems('Edit').click();
|
||||
e2e.components.PanelEditor.applyButton().click();
|
||||
|
||||
// And the last panel should still be visible!
|
||||
e2e.components.Panels.Panel.title('Panel #50').should('be.visible');
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user