Skip to content

Commit

Permalink
Update selector
Browse files Browse the repository at this point in the history
  • Loading branch information
raethlein committed May 6, 2024
1 parent 86b13d1 commit 92a1fe3
Showing 1 changed file with 23 additions and 23 deletions.
46 changes: 23 additions & 23 deletions e2e/specs/st_tooltips_2.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,47 +21,39 @@ describe("displays tooltips on text elements properly", () => {
});

it("Display text properly on tooltips on markdown", () => {
cy.getIndexed(`.stMarkdown .stTooltipIcon`, 0)
.invoke("show")
.click();
cy.getIndexed(`.stMarkdown .stTooltipIcon`, 0).invoke("show").click();
cy.get("[data-testid=stMarkdownContainer]").should(
"contain",
"This is example tooltip displayed on markdown."
);
});

it("Display text properly on tooltips on text", () => {
cy.get(`.stTextLabelWrapper > * > .stTooltipIcon`)
.invoke("show")
.click();
cy.get(`.stTextLabelWrapper > * > .stTooltipIcon`).invoke("show").click();
cy.get("[data-testid=stMarkdownContainer]").should(
"contain",
"This is example tooltip displayed on text."
);
});

it("Display text properly on tooltips on latex", () => {
cy.getIndexed(`.stMarkdown .stTooltipIcon`, 1)
.invoke("show")
.click();
cy.getIndexed(`.stMarkdown .stTooltipIcon`, 1).invoke("show").click();
cy.get("[data-testid=stMarkdownContainer]").should(
"contain",
"This is example tooltip displayed on latex."
);
});

it("Display text properly on tooltips on caption", () => {
cy.getIndexed(`.stMarkdown .stTooltipIcon`, 2)
.invoke("show")
.click();
cy.getIndexed(`.stMarkdown .stTooltipIcon`, 2).invoke("show").click();
cy.get("[data-testid=stMarkdownContainer]").should(
"contain",
"This is example tooltip displayed on caption."
);
});

it("Display text properly on tooltips on title", () => {
cy.getIndexed(`.stMarkdown .stTooltipIcon`, 3)
cy.getIndexed(`[data-testid=stMarkdownContainer] .stTooltipIcon`, 0)
.invoke("show")
.click();
cy.get("[data-testid=stMarkdownContainer]").should(
Expand All @@ -71,7 +63,7 @@ describe("displays tooltips on text elements properly", () => {
});

it("Display text properly on tooltips on header", () => {
cy.getIndexed(`.stMarkdown .stTooltipIcon`, 4)
cy.getIndexed(`[data-testid=stMarkdownContainer] .stTooltipIcon`, 1)
.invoke("show")
.click();
cy.get("[data-testid=stMarkdownContainer]").should(
Expand All @@ -81,7 +73,7 @@ describe("displays tooltips on text elements properly", () => {
});

it("Display text properly on tooltips on subheader", () => {
cy.getIndexed(`.stMarkdown .stTooltipIcon`, 5)
cy.getIndexed(`[data-testid=stMarkdownContainer] .stTooltipIcon`, 2)
.invoke("show")
.click();
cy.get("[data-testid=stMarkdownContainer]").should(
Expand All @@ -91,12 +83,20 @@ describe("displays tooltips on text elements properly", () => {
});

it("Tooltips match image snapshots", () => {
cy.getIndexed(".stTooltipContent", 0).matchImageSnapshot("stTooltipMarkdown")
cy.getIndexed(".stTooltipContent", 1).matchImageSnapshot("stTooltipText")
cy.getIndexed(".stTooltipContent", 2).matchImageSnapshot("stTooltipLatex")
cy.getIndexed(".stTooltipContent", 3).matchImageSnapshot("stTooltipCaption")
cy.getIndexed(".stTooltipContent", 4).matchImageSnapshot("stTooltipTitle")
cy.getIndexed(".stTooltipContent", 5).matchImageSnapshot("stTooltipHeader")
cy.getIndexed(".stTooltipContent", 6).matchImageSnapshot("stTooltipSubheader")
})
cy.getIndexed(".stTooltipContent", 0).matchImageSnapshot(
"stTooltipMarkdown"
);
cy.getIndexed(".stTooltipContent", 1).matchImageSnapshot("stTooltipText");
cy.getIndexed(".stTooltipContent", 2).matchImageSnapshot("stTooltipLatex");
cy.getIndexed(".stTooltipContent", 3).matchImageSnapshot(
"stTooltipCaption"
);
cy.getIndexed(".stTooltipContent", 4).matchImageSnapshot("stTooltipTitle");
cy.getIndexed(".stTooltipContent", 5).matchImageSnapshot(
"stTooltipHeader"
);
cy.getIndexed(".stTooltipContent", 6).matchImageSnapshot(
"stTooltipSubheader"
);
});
});

0 comments on commit 92a1fe3

Please sign in to comment.