17
const defaultTooltip = `This is a really long tooltip.\nLorem ipsum dolor sit am\
18
et, consectetur adipiscing elit. Ut ut turpis vitae\njusto ornare venenatis a \
19
vitae leo. Donec mollis ornare ante, eu ultricies\ntellus ornare eu. Donec ero\
20
s risus, ultrices ut eleifend vel, auctor eu turpis.\nIn consectetur erat vel \
21
ante accumsan, a egestas urna aliquet. Nullam eget\nsapien eget diam euismod e\
22
leifend. Nulla purus enim, finibus ut velit eu,\nmalesuada dictum nulla. In no\
23
n arcu et risus maximus fermentum eget nec ante.`;
25
const tooltipCodeBlock1 = `This\nis\na\ncode\nblock!`;
26
const tooltipCodeBlock2 = `for i in range(10):\n x = i * 10\n print(x)`;
28
const tooltipTextBlock1 = `This is a regular text block!\nTest1\nTest2`;
29
const tooltipTextBlock2 = `thisisatooltipwithnoindents. It has some spaces but\
32
describe("tooltips on widgets", () => {
34
cy.loadApp("http://localhost:3000/");
37
it("displays tooltips on textinput", () => {
38
cy.get(`.stTextInput .stTooltipIcon`).should("have.length", 1);
41
it("displays tooltips on numberinput", () => {
42
cy.get(`.stNumberInput .stTooltipIcon`).should("have.length", 1);
45
it("displays tooltips on checkbox", () => {
46
cy.get(`.stCheckbox .stTooltipIcon`).should("have.length", 1);
49
it("displays tooltips on radio", () => {
50
cy.get(`.stRadio .stTooltipIcon`).should("have.length", 1);
53
it("displays tooltips on button", () => {
55
cy.get(`.stButton .stTooltipIcon`).should("have.length", 2);
58
it("displays tooltips on selectbox", () => {
59
cy.get(`.stSelectbox .stTooltipIcon`).should("have.length", 1);
62
it("displays tooltips on timeinput", () => {
63
cy.get(`.stTimeInput .stTooltipIcon`).should("have.length", 1);
66
it("displays tooltips on dateinput", () => {
67
cy.get(`.stDateInput .stTooltipIcon`).should("have.length", 1);
70
it("displays tooltips on colorpicker", () => {
71
cy.get(`[data-testid="stColorPicker"] .stTooltipIcon`).should(
77
it("displays tooltips on fileuploader", () => {
78
cy.get(`[data-testid="stFileUploader"] .stTooltipIcon`).should(
84
it("displays tooltips on multiselect", () => {
85
cy.get(`.stMultiSelect .stTooltipIcon`).should("have.length", 1);
88
it("displays tooltips on textarea", () => {
89
cy.get(`.stTextArea .stTooltipIcon`).should("have.length", 1);
92
it("displays tooltips on sliders", () => {
94
cy.get(`.stSlider .stTooltipIcon`).should("have.length", 2);
97
it("displays tooltips on metric", () => {
98
cy.get(`[data-testid=stMetricLabel] .stTooltipIcon`).should(
105
describe("tooltip text with dedent on widgets", () => {
107
cy.loadApp("http://localhost:3000/");
112
cy.get(".stApp > header").invoke("css", "display", "none");
115
it("Display text properly on tooltips on text input", () => {
116
cy.get(`.stTextInput .stTooltipIcon`).invoke("show").click();
117
cy.get("[data-testid=stMarkdownContainer]").should(
123
it("Display text properly on tooltips on numberinput", () => {
124
cy.get(`.stNumberInput .stTooltipIcon`).invoke("show").click();
125
cy.get("[data-testid=stMarkdownContainer] .stCodeBlock").should(
131
it("Display text properly on tooltips on checkbox", () => {
132
cy.get(`.stCheckbox .stTooltipIcon`).invoke("show").click();
133
cy.get("[data-testid=stMarkdownContainer]").should(
139
it("Display text properly on tooltips on radio", () => {
140
cy.get(`.stRadio .stTooltipIcon`).invoke("show").click();
141
cy.get("[data-testid=stMarkdownContainer] .stCodeBlock").should(
147
it("Display text properly on tooltips on Selectbox", () => {
148
cy.get(`.stSelectbox .stTooltipIcon`).invoke("show").click();
149
cy.get("[data-testid=stMarkdownContainer]").should(
155
it("Display text properly on tooltips on timeinput", () => {
156
cy.get(`.stTimeInput .stTooltipIcon`).invoke("show").click();
157
cy.get("[data-testid=stMarkdownContainer] .stCodeBlock").should(
163
it("Display text properly on tooltips on dateinput", () => {
164
cy.get(`.stDateInput .stTooltipIcon`).invoke("show").click();
165
cy.get("[data-testid=stMarkdownContainer]").should(
172
it("Display text properly on tooltips on sliders", () => {
173
cy.get(`.stSlider .stTooltipIcon`).eq(0).invoke("show").click();
174
cy.get("[data-testid=stMarkdownContainer] .stCodeBlock").should(
180
it("Display text properly on tooltips on colorpicker", () => {
181
cy.get(`[data-testid="stColorPicker"] .stTooltipIcon`)
184
cy.get("[data-testid=stMarkdownContainer]").should(
190
it("Display text properly on tooltips on fileuploader", () => {
191
cy.get(`[data-testid="stFileUploader"] .stTooltipIcon`)
194
cy.get("[data-testid=stMarkdownContainer]").should(
200
it("Display text properly on tooltips on multiselect", () => {
201
cy.get(`.stMultiSelect .stTooltipIcon`)
203
.click({ force: true })
204
.trigger("mouseover", { force: true });
205
cy.get("[data-testid=stMarkdownContainer] .stCodeBlock").should(
211
it("Display text properly on tooltips on textarea", () => {
212
cy.get(`.stTextArea .stTooltipIcon`)
214
.click({ force: true })
215
.trigger("mouseover", { force: true });
216
cy.get("[data-testid=stMarkdownContainer]").should(
222
it("Display text properly on tooltips on sliders", () => {
223
cy.getIndexed(".stSlider .stTooltipIcon", 1)
225
.trigger("mouseenter", { force: true })
226
.trigger("mouseover", { force: true });
227
cy.get("[data-testid=stMarkdownContainer] .stCodeBlock").should(
233
it("Display text properly on tooltips on button", () => {
234
cy.get(".stButton [data-testid=stTooltipHoverTarget]").trigger(
238
cy.get("[data-testid=stMarkdownContainer]").should(
244
it("Display text properly on tooltips on metric", () => {
246
"[data-testid=stMetricLabel] [data-testid=stTooltipHoverTarget]"
247
).trigger("mouseover", { force: true });
248
cy.get("[data-testid=stMarkdownContainer]").should(