2023-09-08 10:51:59 -05:00
|
|
|
import { e2e } from '../utils';
|
2023-04-24 09:46:31 -05:00
|
|
|
|
2023-04-26 07:43:20 -05:00
|
|
|
const DASHBOARD_ID = 'c01bf42b-b783-4447-a304-8554cee1843b';
|
2023-04-24 09:46:31 -05:00
|
|
|
const DATAGRID_SELECT_SERIES = 'Datagrid Select series';
|
|
|
|
|
2023-11-01 06:28:28 -05:00
|
|
|
//TODO enable this test when panel goes live
|
|
|
|
describe.skip('Datagrid data changes', () => {
|
2023-09-13 07:24:20 -05:00
|
|
|
beforeEach(() => {
|
2023-09-27 05:33:00 -05:00
|
|
|
e2e.flows.login(Cypress.env('USERNAME'), Cypress.env('PASSWORD'));
|
2023-09-13 07:24:20 -05:00
|
|
|
});
|
|
|
|
|
|
|
|
it('Tests changing data in the grid', () => {
|
2023-04-24 09:46:31 -05:00
|
|
|
e2e.flows.openDashboard({ uid: DASHBOARD_ID, queryParams: { editPanel: 1 } });
|
|
|
|
|
|
|
|
// Check that the data is series A
|
|
|
|
e2e.components.PanelEditor.OptionsPane.fieldLabel(DATAGRID_SELECT_SERIES).should('be.visible');
|
|
|
|
cy.get('[data-testid="glide-cell-2-0"]').should('have.text', '1');
|
|
|
|
cy.get('[data-testid="glide-cell-2-1"]').should('have.text', '20');
|
|
|
|
cy.get('[data-testid="glide-cell-2-2"]').should('have.text', '90');
|
|
|
|
|
|
|
|
// Change the series to B
|
|
|
|
e2e.components.PanelEditor.OptionsPane.fieldLabel(DATAGRID_SELECT_SERIES).find('input').type('B {enter}');
|
|
|
|
cy.get('[data-testid="glide-cell-2-3"]').should('have.text', '30');
|
|
|
|
cy.get('[data-testid="glide-cell-2-4"]').should('have.text', '40');
|
|
|
|
cy.get('[data-testid="glide-cell-2-5"]').should('have.text', '50');
|
|
|
|
|
|
|
|
// Edit datagrid which triggers a snapshot query
|
|
|
|
cy.get('.dvn-scroller').click(200, 100);
|
|
|
|
cy.get('[data-testid="glide-cell-2-1"]').should('have.attr', 'aria-selected', 'true');
|
2023-04-26 07:43:20 -05:00
|
|
|
cy.get('body').type('12{enter}', { delay: 500 });
|
2023-04-24 09:46:31 -05:00
|
|
|
|
2023-05-08 11:02:20 -05:00
|
|
|
cy.get('[data-testid="data-testid Confirm Modal Danger Button"]').click();
|
2023-04-26 07:43:20 -05:00
|
|
|
|
|
|
|
cy.get('[data-testid="query-editor-row"]').contains('Snapshot');
|
2023-09-13 07:24:20 -05:00
|
|
|
});
|
2023-04-24 09:46:31 -05:00
|
|
|
});
|