Skip to content

Commit 393a593

Browse files
committed
Add repro for #233 and accept problematic baselines
1 parent 2dddad3 commit 393a593

File tree

3 files changed

+151
-0
lines changed

3 files changed

+151
-0
lines changed
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
// Jest Snapshot v1, https://goo.gl/fbAQLP
2+
3+
exports[`issue233.ts 1`] = `
4+
5+
File: issue233.ts
6+
Source code:
7+
8+
declare const styled: any;
9+
10+
// repro from #233
11+
const ValueCalc = styled.div\`
12+
height: calc(var(--line-height) - 5px);
13+
width: calc(100% - 5px);
14+
\`;
15+
16+
// another case from #233
17+
styled.div\`--padding-button: calc(var(--padding-button-vertical) - 2px) calc(var(--padding-button-horizontal) - 2px);\`
18+
19+
// a few more cases
20+
styled.div\`
21+
width: calc( 1%)
22+
width: calc( 1% + var(--a) - calc(2%))
23+
width: calc( 1% + var(--a) - calc(2%) + calc( 1px + calc(1px + 2px) + var(--a)))
24+
\`
25+
26+
27+
TypeScript before transform:
28+
29+
declare const styled: any;
30+
// repro from #233
31+
const ValueCalc = styled.div \`
32+
height: calc(var(--line-height) - 5px);
33+
width: calc(100% - 5px);
34+
\`;
35+
// another case from #233
36+
styled.div \`--padding-button: calc(var(--padding-button-vertical) - 2px) calc(var(--padding-button-horizontal) - 2px);\`;
37+
// a few more cases
38+
styled.div \`
39+
width: calc( 1%)
40+
width: calc( 1% + var(--a) - calc(2%))
41+
width: calc( 1% + var(--a) - calc(2%) + calc( 1px + calc(1px + 2px) + var(--a)))
42+
\`;
43+
44+
45+
TypeScript after transform:
46+
47+
declare const styled: any;
48+
// repro from #233
49+
const ValueCalc = styled.div \`height:calc(var(--line-height)- 5px);width:calc(100% - 5px);\`;
50+
// another case from #233
51+
styled.div \`--padding-button:calc(var(--padding-button-vertical)- 2px) calc(var(--padding-button-horizontal)- 2px);\`;
52+
// a few more cases
53+
styled.div \`width:calc( 1%)width:calc( 1% + var(--a)- calc(2%)) width:calc( 1% + var(--a)- calc(2%)+ calc( 1px + calc(1px + 2px)+ var(--a)))\`;
54+
55+
56+
TypeScript after transpile module:
57+
58+
// repro from #233
59+
const ValueCalc = styled.div \`height:calc(var(--line-height)- 5px);width:calc(100% - 5px);\`;
60+
// another case from #233
61+
styled.div \`--padding-button:calc(var(--padding-button-vertical)- 2px) calc(var(--padding-button-horizontal)- 2px);\`;
62+
// a few more cases
63+
styled.div \`width:calc( 1%)width:calc( 1% + var(--a)- calc(2%)) width:calc( 1% + var(--a)- calc(2%)+ calc( 1px + calc(1px + 2px)+ var(--a)))\`;
64+
65+
66+
67+
`;
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
// Jest Snapshot v1, https://goo.gl/fbAQLP
2+
3+
exports[`issue233.ts 1`] = `
4+
5+
File: issue233.ts
6+
Source code:
7+
8+
declare const styled: any;
9+
10+
// repro from #233
11+
const ValueCalc = styled.div\`
12+
height: calc(var(--line-height) - 5px);
13+
width: calc(100% - 5px);
14+
\`;
15+
16+
// another case from #233
17+
styled.div\`--padding-button: calc(var(--padding-button-vertical) - 2px) calc(var(--padding-button-horizontal) - 2px);\`
18+
19+
// a few more cases
20+
styled.div\`
21+
width: calc( 1%)
22+
width: calc( 1% + var(--a) - calc(2%))
23+
width: calc( 1% + var(--a) - calc(2%) + calc( 1px + calc(1px + 2px) + var(--a)))
24+
\`
25+
26+
27+
TypeScript before transform:
28+
29+
declare const styled: any;
30+
// repro from #233
31+
const ValueCalc = styled.div \`
32+
height: calc(var(--line-height) - 5px);
33+
width: calc(100% - 5px);
34+
\`;
35+
// another case from #233
36+
styled.div \`--padding-button: calc(var(--padding-button-vertical) - 2px) calc(var(--padding-button-horizontal) - 2px);\`;
37+
// a few more cases
38+
styled.div \`
39+
width: calc( 1%)
40+
width: calc( 1% + var(--a) - calc(2%))
41+
width: calc( 1% + var(--a) - calc(2%) + calc( 1px + calc(1px + 2px) + var(--a)))
42+
\`;
43+
44+
45+
TypeScript after transform:
46+
47+
declare const styled: any;
48+
// repro from #233
49+
const ValueCalc = styled.div.withConfig({ displayName: "ValueCalc" }) \`height:calc(var(--line-height)- 5px);width:calc(100% - 5px);\`;
50+
// another case from #233
51+
styled.div \`--padding-button:calc(var(--padding-button-vertical)- 2px) calc(var(--padding-button-horizontal)- 2px);\`;
52+
// a few more cases
53+
styled.div \`width:calc( 1%)width:calc( 1% + var(--a)- calc(2%)) width:calc( 1% + var(--a)- calc(2%)+ calc( 1px + calc(1px + 2px)+ var(--a)))\`;
54+
55+
56+
TypeScript after transpile module:
57+
58+
// repro from #233
59+
const ValueCalc = styled.div.withConfig({ displayName: "ValueCalc" }) \`height:calc(var(--line-height)- 5px);width:calc(100% - 5px);\`;
60+
// another case from #233
61+
styled.div \`--padding-button:calc(var(--padding-button-vertical)- 2px) calc(var(--padding-button-horizontal)- 2px);\`;
62+
// a few more cases
63+
styled.div \`width:calc( 1%)width:calc( 1% + var(--a)- calc(2%)) width:calc( 1% + var(--a)- calc(2%)+ calc( 1px + calc(1px + 2px)+ var(--a)))\`;
64+
65+
66+
67+
`;
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
declare const styled: any;
2+
3+
// repro from #233
4+
const ValueCalc = styled.div`
5+
height: calc(var(--line-height) - 5px);
6+
width: calc(100% - 5px);
7+
`;
8+
9+
// another case from #233
10+
styled.div`--padding-button: calc(var(--padding-button-vertical) - 2px) calc(var(--padding-button-horizontal) - 2px);`
11+
12+
// a few more cases
13+
styled.div`
14+
width: calc( 1%)
15+
width: calc( 1% + var(--a) - calc(2%))
16+
width: calc( 1% + var(--a) - calc(2%) + calc( 1px + calc(1px + 2px) + var(--a)))
17+
`

0 commit comments

Comments
 (0)