Skip to content

Commit 8c1ce2a

Browse files
committed
test: fix tests
1 parent 5a974af commit 8c1ce2a

File tree

4 files changed

+24
-83
lines changed

4 files changed

+24
-83
lines changed

src/components/Parallax/__snapshots__/index.test.tsx.snap

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,11 @@ exports[`Expect the <Parallax> component to render correctly 1`] = `
44
<DocumentFragment>
55
<figure
66
class="class-foo"
7-
style="border: 2px solid red;"
7+
style="border: 2px solid red; will-change: transform; transform: translateX(100%)translateY(100%);"
88
>
99
<div
10-
class="class-foo"
11-
style="border: 23px solid blue; will-change: transform; transform: translateX(100%)translateY(100%);"
12-
>
13-
<div
14-
class="foo"
15-
/>
16-
</div>
10+
class="foo"
11+
/>
1712
</figure>
1813
</DocumentFragment>
1914
`;

src/components/Parallax/index.test.tsx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,13 @@ describe('Expect the <Parallax> component', () => {
2727
<ParallaxProvider>
2828
<Parallax
2929
className="class-foo"
30-
innerClassName="class-foo"
3130
disabled={false}
3231
translateX={[-100, 100]}
3332
translateY={['-100%', '100%']}
3433
style={{
3534
border: 'solid red 2px',
3635
}}
37-
innerStyle={{
38-
border: 'solid blue 23px',
39-
}}
4036
tag="figure"
41-
innerTag="div"
4237
>
4338
<div className="foo" />
4439
</Parallax>

src/components/ParallaxBanner/__snapshots__/index.test.tsx.snap

Lines changed: 21 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -26,31 +26,19 @@ exports[`Expect the <ParallaxBanner> component to render custom child banners co
2626
}
2727
>
2828
<div
29+
className="parallax-banner-layer-0"
2930
style={
3031
Object {
31-
"bottom": 0,
32+
"bottom": "-20px",
3233
"left": 0,
3334
"position": "absolute",
3435
"right": 0,
35-
"top": 0,
36+
"top": "-20px",
3637
}
3738
}
3839
>
39-
<div
40-
className="parallax-banner-layer-0"
41-
style={
42-
Object {
43-
"bottom": "-20px",
44-
"left": 0,
45-
"position": "absolute",
46-
"right": 0,
47-
"top": "-20px",
48-
}
49-
}
50-
>
51-
<div>
52-
test
53-
</div>
40+
<div>
41+
test
5442
</div>
5543
</div>
5644
</div>
@@ -83,32 +71,20 @@ exports[`Expect the <ParallaxBanner> component to render image banners correctly
8371
}
8472
>
8573
<div
74+
className="parallax-banner-layer-0"
8675
style={
8776
Object {
88-
"bottom": 0,
77+
"backgroundImage": "url(https://foo.com/bar.jpg)",
78+
"backgroundPosition": "center",
79+
"backgroundSize": "cover",
80+
"bottom": "-20px",
8981
"left": 0,
9082
"position": "absolute",
9183
"right": 0,
92-
"top": 0,
84+
"top": "-20px",
9385
}
9486
}
95-
>
96-
<div
97-
className="parallax-banner-layer-0"
98-
style={
99-
Object {
100-
"backgroundImage": "url(https://foo.com/bar.jpg)",
101-
"backgroundPosition": "center",
102-
"backgroundSize": "cover",
103-
"bottom": "-20px",
104-
"left": 0,
105-
"position": "absolute",
106-
"right": 0,
107-
"top": "-20px",
108-
}
109-
}
110-
/>
111-
</div>
87+
/>
11288
</div>
11389
<div>
11490
<h1>
@@ -142,31 +118,19 @@ exports[`Expect the <ParallaxBanner> component to render layers with custom prop
142118
}
143119
>
144120
<div
121+
className="parallax-banner-layer-0 my-custom-class"
122+
id="my-id"
145123
style={
146124
Object {
147-
"bottom": 0,
125+
"backgroundColor": "red",
126+
"bottom": "-20px",
148127
"left": 0,
149128
"position": "absolute",
150129
"right": 0,
151-
"top": 0,
130+
"top": "-20px",
152131
}
153132
}
154-
>
155-
<div
156-
className="parallax-banner-layer-0 my-custom-class"
157-
id="my-id"
158-
style={
159-
Object {
160-
"backgroundColor": "red",
161-
"bottom": "-20px",
162-
"left": 0,
163-
"position": "absolute",
164-
"right": 0,
165-
"top": "-20px",
166-
}
167-
}
168-
/>
169-
</div>
133+
/>
170134
</div>
171135
</div>
172136
`;
@@ -195,6 +159,7 @@ exports[`Expect the <ParallaxBanner> component to render without expanded margin
195159
}
196160
>
197161
<div
162+
className="parallax-banner-layer-0"
198163
style={
199164
Object {
200165
"bottom": 0,
@@ -205,21 +170,8 @@ exports[`Expect the <ParallaxBanner> component to render without expanded margin
205170
}
206171
}
207172
>
208-
<div
209-
className="parallax-banner-layer-0"
210-
style={
211-
Object {
212-
"bottom": 0,
213-
"left": 0,
214-
"position": "absolute",
215-
"right": 0,
216-
"top": 0,
217-
}
218-
}
219-
>
220-
<div>
221-
test
222-
</div>
173+
<div>
174+
test
223175
</div>
224176
</div>
225177
</div>

src/components/ParallaxBanner/index.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ export const ParallaxBanner = ({
7373
<Parallax
7474
key={`layer-${i}`}
7575
speed={speed}
76-
innerStyle={absoluteStyle}
7776
style={absoluteStyle}
7877
disabled={disabled}
7978
>

0 commit comments

Comments
 (0)