Skip to content

Commit 633cf72

Browse files
danielbariongabrieljablonski
authored andcommitted
test: refactor tests with testing-library and jest
1 parent c13e146 commit 633cf72

File tree

7 files changed

+427
-336
lines changed

7 files changed

+427
-336
lines changed

src/test/__snapshots__/index.spec.js.snap

Lines changed: 0 additions & 105 deletions
This file was deleted.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// Jest Snapshot v1, https://goo.gl/fbAQLP
2+
3+
exports[`tooltip props basic tooltip component 1`] = `
4+
<div>
5+
<span
6+
class="react-tooltip-wrapper"
7+
data-tooltip-content="Shared Global Tooltip"
8+
data-tooltip-place="bottom"
9+
>
10+
<button>
11+
Minimal 1
12+
</button>
13+
</span>
14+
<div
15+
class="react-tooltip"
16+
role="tooltip"
17+
style="left: 5px; top: 10px;"
18+
>
19+
<button>
20+
button
21+
</button>
22+
<div
23+
class="react-tooltip-arrow"
24+
style="left: 5px; top: -4px;"
25+
/>
26+
</div>
27+
</div>
28+
`;
Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
// Jest Snapshot v1, https://goo.gl/fbAQLP
2+
3+
exports[`tooltip attributes basic tooltip component 1`] = `
4+
<div>
5+
<span
6+
data-tooltip-content="Hello World!"
7+
id="basic-example-attr"
8+
>
9+
Lorem Ipsum
10+
</span>
11+
<div
12+
class="react-tooltip"
13+
role="tooltip"
14+
>
15+
Hello World!
16+
<div
17+
class="react-tooltip-arrow"
18+
/>
19+
</div>
20+
</div>
21+
`;
22+
23+
exports[`tooltip attributes tooltip component - without element reference 1`] = `
24+
<div>
25+
<span
26+
data-tooltip-content="Hello World!"
27+
>
28+
Lorem Ipsum
29+
</span>
30+
</div>
31+
`;
32+
33+
exports[`tooltip attributes tooltip component with place 1`] = `
34+
<div>
35+
<span
36+
data-tooltip-content="Hello World!"
37+
data-tooltip-place="right"
38+
id="example-place-attr"
39+
>
40+
Lorem Ipsum
41+
</span>
42+
<div
43+
class="react-tooltip"
44+
role="tooltip"
45+
>
46+
Hello World!
47+
<div
48+
class="react-tooltip-arrow"
49+
/>
50+
</div>
51+
</div>
52+
`;
53+
54+
exports[`tooltip props basic tooltip component 1`] = `
55+
<div>
56+
<span
57+
id="basic-example"
58+
>
59+
Lorem Ipsum
60+
</span>
61+
<div
62+
class="react-tooltip"
63+
role="tooltip"
64+
>
65+
Hello World!
66+
<div
67+
class="react-tooltip-arrow"
68+
/>
69+
</div>
70+
</div>
71+
`;
72+
73+
exports[`tooltip props tooltip component - without element reference 1`] = `
74+
<div>
75+
<span>
76+
Lorem Ipsum
77+
</span>
78+
</div>
79+
`;
80+
81+
exports[`tooltip props tooltip component with html 1`] = `
82+
<div>
83+
<span
84+
id="example-html"
85+
>
86+
Lorem Ipsum
87+
</span>
88+
<div
89+
class="react-tooltip"
90+
role="tooltip"
91+
>
92+
<span>
93+
<div>
94+
Hello World!
95+
<div />
96+
</div>
97+
</span>
98+
<div
99+
class="react-tooltip-arrow"
100+
/>
101+
</div>
102+
</div>
103+
`;
104+
105+
exports[`tooltip props tooltip component with place 1`] = `
106+
<div>
107+
<span
108+
id="example-place"
109+
>
110+
Lorem Ipsum
111+
</span>
112+
<div
113+
class="react-tooltip"
114+
role="tooltip"
115+
>
116+
Hello World!
117+
<div
118+
class="react-tooltip-arrow"
119+
/>
120+
</div>
121+
</div>
122+
`;

0 commit comments

Comments
 (0)