Skip to content

Commit

Permalink
Cypress: Assert results keep up on widget refresh (#4846)
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrieldutra authored Apr 30, 2020
1 parent e3fff39 commit ae9bbe2
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions client/cypress/integration/dashboard/widget_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,4 +198,24 @@ describe("Widget", () => {
cy.percySnapshot("Shows fixed mini pagination for overflowing tabular content");
});
});

it("keeps results on screen while refreshing", function() {
const queryData = {
query: "select pg_sleep({{sleep-time}}), 'sleep time: {{sleep-time}}' as sleeptime",
options: { parameters: [{ name: "sleep-time", title: "Sleep time", type: "number", value: 0 }] },
};

createQueryAndAddWidget(this.dashboardId, queryData).then(elTestId => {
cy.visit(this.dashboardUrl);
cy.getByTestId(elTestId).within(() => {
cy.getByTestId("TableVisualization").should("contain", "sleep time: 0");
cy.get(".refresh-indicator").should("not.be.visible");

cy.getByTestId("ParameterName-sleep-time").type("10");
cy.getByTestId("ParameterApplyButton").click();
cy.get(".refresh-indicator").should("be.visible");
cy.getByTestId("TableVisualization").should("contain", "sleep time: 0");
});
});
});
});

0 comments on commit ae9bbe2

Please sign in to comment.