Skip to content
Snippets Groups Projects
Unverified Commit 1e3998de authored by Jessica DeWitt's avatar Jessica DeWitt Committed by GitHub
Browse files

repro/Dash w text box cards (#12914)


* Text box should work

* prettier

* test for Issue #12766

* unskip test that should already be fixed

* Update text-box.cy.spec.js

* unskip test

Co-authored-by: default avatarPaul Rosenzweig <paulrosenzweig@users.noreply.github.com>
Co-authored-by: default avatarPaul Rosenzweig <paul.a.rosenzweig@gmail.com>
parent d86b85ce
No related branches found
No related tags found
No related merge requests found
import { signInAsAdmin, restore } from "__support__/cypress";
function addTextBox(string) {
cy.get(".Icon-pencil").click();
cy.get(".Icon-string").click();
cy.findByPlaceholderText("Write here, and use Markdown if you'd like").type(
string,
);
}
describe("scenarios > dashboard > text-box", () => {
describe("when text-box is the only element on the dashboard", () => {
beforeEach(() => {
restore(); // restore before each so we can reuse dashboard id
signInAsAdmin();
// Create dashboard
cy.server();
cy.request("POST", "/api/dashboard", {
name: "Test Dashboard",
});
});
it("should load after save/refresh (Issue #12914)", () => {
cy.visit(`/dashboard/2`);
cy.findByText("Test Dashboard");
cy.findByText("This dashboard is looking empty.");
// Add save text box to dash
addTextBox("Dashboard testing text");
cy.findByText("Save").click();
cy.findByText("Saving…");
cy.findByText("Saving…").should("not.exist");
// Reload page
cy.reload();
// Page should still load
cy.findByText("Ask a question");
cy.findByText("Loading...").should("not.exist");
cy.findByText("Cannot read property 'type' of undefined").should(
"not.exist",
);
cy.findByText("Test Dashboard");
// Text box should still load
cy.findByText("Dashboard testing text");
});
it.skip("should have a scroll bar for long text (Issue #8333)", () => {
cy.visit(`/dashboard/2`);
// Add text box to dash
addTextBox(
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.",
);
cy.findByText("Save").click();
cy.get(".CardVisualization").scrollTo("bottom");
cy.findByText("ex ea commodo consequat.");
cy.findByText("Lorem ipsum dolor sit amet").should("not.exist");
});
});
});
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment