Skip to content

Commit 9266e3e

Browse files
seiyabfisker
andauthored
Add resolved test cases (#18358)
Co-authored-by: fisker Cheung <lionkay@gmail.com>
1 parent 3bfc014 commit 9266e3e

File tree

7 files changed

+173
-0
lines changed

7 files changed

+173
-0
lines changed

tests/format/css/atrule/__snapshots__/format.test.js.snap

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4296,6 +4296,16 @@ B
42964296
@supports (transform-style: preserve-3d) or ((-moz-transform-style: preserve-3d) or
42974297
((-o-transform-style: preserve-3d) or (-webkit-transform-style: preserve-3d))) {}
42984298
4299+
/* #8201 */
4300+
@supports (--element(".minwidth", {"minWidth": 300})) {
4301+
[--self] {
4302+
background: greenyellow;
4303+
}
4304+
}
4305+
@supports ({"example": 1}) {
4306+
* { background: red; }
4307+
}
4308+
42994309
=====================================output=====================================
43004310
@supports (transform-origin: 5% 5%) {
43014311
}
@@ -4573,6 +4583,18 @@ B
45734583
) {
45744584
}
45754585
4586+
/* #8201 */
4587+
@supports (--element(".minwidth", {"minWidth": 300})) {
4588+
[--self] {
4589+
background: greenyellow;
4590+
}
4591+
}
4592+
@supports ({"example": 1}) {
4593+
* {
4594+
background: red;
4595+
}
4596+
}
4597+
45764598
================================================================================
45774599
`;
45784600

tests/format/css/atrule/supports.css

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,3 +381,13 @@ B
381381

382382
@supports (transform-style: preserve-3d) or ((-moz-transform-style: preserve-3d) or
383383
((-o-transform-style: preserve-3d) or (-webkit-transform-style: preserve-3d))) {}
384+
385+
/* #8201 */
386+
@supports (--element(".minwidth", {"minWidth": 300})) {
387+
[--self] {
388+
background: greenyellow;
389+
}
390+
}
391+
@supports ({"example": 1}) {
392+
* { background: red; }
393+
}

tests/format/css/fill-value/__snapshots__/format.test.js.snap

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,39 @@ div {
1111
$fontFamily: "Lato", -apple-system, "Helvetica Neue", Helvetica, Arial, sans-serif;
1212
}
1313
14+
/* #4460 */
15+
.SearchBox {
16+
box-shadow: 0 1rem 6rem rgba(0, 0, 0, 0.18), 0 0.3rem 1rem rgba(0, 0, 0, 0.17);
17+
}
18+
19+
.SearchBox {
20+
@include foo {
21+
margin-left: sg-layout-width(logo-shopify) / 2 * -1 + sg-offset-x(page-nav) / 2;
22+
}
23+
}
24+
25+
.SearchBox {
26+
box-shadow: 0 1rem 6rem rgba(0, 0, 0, 0.18), 0 0.3rem 1rem rgba(0, 0, 0, 0.17) !important;
27+
}
28+
29+
.demo {
30+
background-position: 0 0, 0 spacing(tight), spacing(tight) -1 * spacing(tight), -1 * spacing(tight) 0;
31+
}
32+
33+
/* #4604 */
34+
.this-will-not-wrap {
35+
background: transparent url(/long/path/to/dummy-image.svg) -1000px center no-repeat;
36+
}
37+
38+
.this-will-wrap-correctly {
39+
background: transparent url(/long/path/to/dummy-image.svg) 1000px center no-repeat;
40+
}
41+
42+
.this-will-also-wrap-but-incorrectly {
43+
background: transparent url(/even/longer/path/to/dummy-image.svg) -1000px center no-repeat;
44+
}
45+
46+
1447
=====================================output=====================================
1548
div {
1649
border-left: 1px solid
@@ -24,5 +57,49 @@ div {
2457
sans-serif;
2558
}
2659
60+
/* #4460 */
61+
.SearchBox {
62+
box-shadow:
63+
0 1rem 6rem rgba(0, 0, 0, 0.18),
64+
0 0.3rem 1rem rgba(0, 0, 0, 0.17);
65+
}
66+
67+
.SearchBox {
68+
@include foo {
69+
margin-left: sg-layout-width(logo-shopify) / 2 * -1 +
70+
sg-offset-x(page-nav) / 2;
71+
}
72+
}
73+
74+
.SearchBox {
75+
box-shadow:
76+
0 1rem 6rem rgba(0, 0, 0, 0.18),
77+
0 0.3rem 1rem rgba(0, 0, 0, 0.17) !important;
78+
}
79+
80+
.demo {
81+
background-position:
82+
0 0,
83+
0 spacing(tight),
84+
spacing(tight) -1 * spacing(tight),
85+
-1 * spacing(tight) 0;
86+
}
87+
88+
/* #4604 */
89+
.this-will-not-wrap {
90+
background: transparent url(/long/path/to/dummy-image.svg) -1000px center
91+
no-repeat;
92+
}
93+
94+
.this-will-wrap-correctly {
95+
background: transparent url(/long/path/to/dummy-image.svg) 1000px center
96+
no-repeat;
97+
}
98+
99+
.this-will-also-wrap-but-incorrectly {
100+
background: transparent url(/even/longer/path/to/dummy-image.svg) -1000px
101+
center no-repeat;
102+
}
103+
27104
================================================================================
28105
`;

tests/format/css/fill-value/fill.css

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,36 @@ div {
22
border-left: 1px solid mix($warningBackgroundColors, $warningBorderColors, 50%);
33
$fontFamily: "Lato", -apple-system, "Helvetica Neue", Helvetica, Arial, sans-serif;
44
}
5+
6+
/* #4460 */
7+
.SearchBox {
8+
box-shadow: 0 1rem 6rem rgba(0, 0, 0, 0.18), 0 0.3rem 1rem rgba(0, 0, 0, 0.17);
9+
}
10+
11+
.SearchBox {
12+
@include foo {
13+
margin-left: sg-layout-width(logo-shopify) / 2 * -1 + sg-offset-x(page-nav) / 2;
14+
}
15+
}
16+
17+
.SearchBox {
18+
box-shadow: 0 1rem 6rem rgba(0, 0, 0, 0.18), 0 0.3rem 1rem rgba(0, 0, 0, 0.17) !important;
19+
}
20+
21+
.demo {
22+
background-position: 0 0, 0 spacing(tight), spacing(tight) -1 * spacing(tight), -1 * spacing(tight) 0;
23+
}
24+
25+
/* #4604 */
26+
.this-will-not-wrap {
27+
background: transparent url(/long/path/to/dummy-image.svg) -1000px center no-repeat;
28+
}
29+
30+
.this-will-wrap-correctly {
31+
background: transparent url(/long/path/to/dummy-image.svg) 1000px center no-repeat;
32+
}
33+
34+
.this-will-also-wrap-but-incorrectly {
35+
background: transparent url(/even/longer/path/to/dummy-image.svg) -1000px center no-repeat;
36+
}
37+

tests/format/jsx/template/__snapshots__/format.test.js.snap

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,15 @@ printWidth: 80
2525
\`}
2626
</style>;
2727
28+
// #5886
29+
<style jsx>{\`
30+
.class {
31+
flex-direction: column\${long_cond && long_cond && long_cond
32+
? "-reverse"
33+
: ""};
34+
}
35+
\`}</style>;
36+
2837
=====================================output=====================================
2938
<style jsx>{\`
3039
p {
@@ -46,5 +55,14 @@ printWidth: 80
4655
\`}
4756
</style>;
4857
58+
// #5886
59+
<style jsx>{\`
60+
.class {
61+
flex-direction: column\${long_cond && long_cond && long_cond
62+
? "-reverse"
63+
: ""};
64+
}
65+
\`}</style>;
66+
4967
================================================================================
5068
`;

tests/format/jsx/template/styled-components.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,12 @@
1616
}
1717
`}
1818
</style>;
19+
20+
// #5886
21+
<style jsx>{`
22+
.class {
23+
flex-direction: column${long_cond && long_cond && long_cond
24+
? "-reverse"
25+
: ""};
26+
}
27+
`}</style>;
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// #6250
2+
const foo
3+
= 'bar'
4+
;

0 commit comments

Comments
 (0)