Skip to content

Commit 9d80bbf

Browse files
authored
fix(scrollMode: if-needed): horizontal edge cases (#24)
Fix #17 and while at it add a proper test suite with jest + puppeteer.
1 parent e9fa0a8 commit 9d80bbf

11 files changed

+2703
-56
lines changed
Lines changed: 202 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,202 @@
1+
// Jest Snapshot v1, https://goo.gl/fbAQLP
2+
3+
exports[`scrollMode: always block: center, inline: center 1`] = `
4+
Object {
5+
"left": 150,
6+
"top": 150,
7+
}
8+
`;
9+
10+
exports[`scrollMode: always block: center, inline: end 1`] = `
11+
Object {
12+
"left": 100,
13+
"top": 150,
14+
}
15+
`;
16+
17+
exports[`scrollMode: always block: center, inline: nearest 1`] = `
18+
Object {
19+
"left": 100,
20+
"top": 150,
21+
}
22+
`;
23+
24+
exports[`scrollMode: always block: center, inline: nearest 2`] = `
25+
Object {
26+
"left": 200,
27+
"top": 150,
28+
}
29+
`;
30+
31+
exports[`scrollMode: always block: center, inline: start 1`] = `
32+
Object {
33+
"left": 200,
34+
"top": 150,
35+
}
36+
`;
37+
38+
exports[`scrollMode: always block: end, inline: center 1`] = `
39+
Object {
40+
"left": 150,
41+
"top": 100,
42+
}
43+
`;
44+
45+
exports[`scrollMode: always block: end, inline: end 1`] = `
46+
Object {
47+
"left": 100,
48+
"top": 100,
49+
}
50+
`;
51+
52+
exports[`scrollMode: always block: end, inline: nearest 1`] = `
53+
Object {
54+
"left": 100,
55+
"top": 100,
56+
}
57+
`;
58+
59+
exports[`scrollMode: always block: end, inline: nearest 2`] = `
60+
Object {
61+
"left": 200,
62+
"top": 100,
63+
}
64+
`;
65+
66+
exports[`scrollMode: always block: end, inline: start 1`] = `
67+
Object {
68+
"left": 200,
69+
"top": 100,
70+
}
71+
`;
72+
73+
exports[`scrollMode: always block: nearest, inline: center 1`] = `
74+
Object {
75+
"left": 150,
76+
"top": 100,
77+
}
78+
`;
79+
80+
exports[`scrollMode: always block: nearest, inline: center 2`] = `
81+
Object {
82+
"left": 150,
83+
"top": 200,
84+
}
85+
`;
86+
87+
exports[`scrollMode: always block: nearest, inline: end 1`] = `
88+
Object {
89+
"left": 100,
90+
"top": 100,
91+
}
92+
`;
93+
94+
exports[`scrollMode: always block: nearest, inline: end 2`] = `
95+
Object {
96+
"left": 100,
97+
"top": 200,
98+
}
99+
`;
100+
101+
exports[`scrollMode: always block: nearest, inline: nearest 1`] = `
102+
Object {
103+
"left": 100,
104+
"top": 100,
105+
}
106+
`;
107+
108+
exports[`scrollMode: always block: nearest, inline: nearest 2`] = `
109+
Object {
110+
"left": 200,
111+
"top": 200,
112+
}
113+
`;
114+
115+
exports[`scrollMode: always block: nearest, inline: start 1`] = `
116+
Object {
117+
"left": 200,
118+
"top": 100,
119+
}
120+
`;
121+
122+
exports[`scrollMode: always block: nearest, inline: start 2`] = `
123+
Object {
124+
"left": 200,
125+
"top": 200,
126+
}
127+
`;
128+
129+
exports[`scrollMode: always block: start, inline: center 1`] = `
130+
Object {
131+
"left": 150,
132+
"top": 200,
133+
}
134+
`;
135+
136+
exports[`scrollMode: always block: start, inline: end 1`] = `
137+
Object {
138+
"left": 100,
139+
"top": 200,
140+
}
141+
`;
142+
143+
exports[`scrollMode: always block: start, inline: nearest 1`] = `
144+
Object {
145+
"left": 100,
146+
"top": 200,
147+
}
148+
`;
149+
150+
exports[`scrollMode: always block: start, inline: nearest 2`] = `
151+
Object {
152+
"left": 200,
153+
"top": 200,
154+
}
155+
`;
156+
157+
exports[`scrollMode: always block: start, inline: start 1`] = `
158+
Object {
159+
"left": 200,
160+
"top": 200,
161+
}
162+
`;
163+
164+
exports[`scrollMode: if-needed horizontal completely overflowing 1`] = `
165+
Array [
166+
Object {
167+
"el": Object {},
168+
"left": 100,
169+
"top": 150,
170+
},
171+
]
172+
`;
173+
174+
exports[`scrollMode: if-needed horizontal partially overflowing 1`] = `
175+
Array [
176+
Object {
177+
"el": Object {},
178+
"left": 100,
179+
"top": 150,
180+
},
181+
]
182+
`;
183+
184+
exports[`scrollMode: if-needed vertical completely below the fold 1`] = `
185+
Array [
186+
Object {
187+
"el": Object {},
188+
"left": 100,
189+
"top": 150,
190+
},
191+
]
192+
`;
193+
194+
exports[`scrollMode: if-needed vertical partially below the fold 1`] = `
195+
Array [
196+
Object {
197+
"el": Object {},
198+
"left": 100,
199+
"top": 150,
200+
},
201+
]
202+
`;

0 commit comments

Comments
 (0)