3
3
exports [` ssr should add a nonce to the stylesheet if webpack nonce is detected in the global scope 1` ] = ` "<h1 class =\\"sc-b c\\">Hello SSR!</h1>"`;
4
4
5
5
exports[`ssr should add a nonce to the stylesheet if webpack nonce is detected in the global scope 2`] = `
6
- " <style nonce=\\" foo\\" data-styled =\\"true\\" data-styled-version =\\"JEST_MOCK_VERSION\\">.c{color:red;}
7
- data-styled.g1[id=\\"sc-b\\"]{content:\\"c,\\"}
8
- body{background:papayawhip;}
9
- data-styled.g2[id=\\"sc-global-a1\\"]{content:\\"sc-global-a1,\\"}
6
+ " <style nonce=\\" foo\\" data-styled =\\"true\\" data-styled-version =\\"JEST_MOCK_VERSION\\">.c{color:red;}/*!sc*/
7
+ data-styled.g1[id=\\"sc-b\\"]{content:\\"c,\\"}/*!sc*/
8
+ body{background:papayawhip;}/*!sc*/
9
+ data-styled.g2[id=\\"sc-global-a1\\"]{content:\\"sc-global-a1,\\"}/*!sc*/
10
10
</style>"
11
11
`;
12
12
13
13
exports[`ssr should extract both global and local CSS 1`] = `"<h1 class =\\"sc-b c\\">Hello SSR!</h1>"`;
14
14
15
15
exports[`ssr should extract both global and local CSS 2`] = `
16
- " <style data-styled=\\" true\\" data-styled-version =\\"JEST_MOCK_VERSION\\">.c{color:red;}
17
- data-styled.g1[id=\\"sc-b\\"]{content:\\"c,\\"}
18
- body{background:papayawhip;}
19
- data-styled.g2[id=\\"sc-global-a1\\"]{content:\\"sc-global-a1,\\"}
16
+ " <style data-styled=\\" true\\" data-styled-version =\\"JEST_MOCK_VERSION\\">.c{color:red;}/*!sc*/
17
+ data-styled.g1[id=\\"sc-b\\"]{content:\\"c,\\"}/*!sc*/
18
+ body{background:papayawhip;}/*!sc*/
19
+ data-styled.g2[id=\\"sc-global-a1\\"]{content:\\"sc-global-a1,\\"}/*!sc*/
20
20
</style>"
21
21
`;
22
22
23
23
exports[`ssr should extract the CSS in a simple case 1`] = `"<h1 class =\\"sc-a b\\">Hello SSR!</h1>"`;
24
24
25
25
exports[`ssr should extract the CSS in a simple case 2`] = `
26
- " <style data-styled=\\" true\\" data-styled-version =\\"JEST_MOCK_VERSION\\">.b{color:red;}
27
- data-styled.g1[id=\\"sc-a\\"]{content:\\"b,\\"}
26
+ " <style data-styled=\\" true\\" data-styled-version =\\"JEST_MOCK_VERSION\\">.b{color:red;}/*!sc*/
27
+ data-styled.g1[id=\\"sc-a\\"]{content:\\"b,\\"}/*!sc*/
28
28
</style>"
29
29
`;
30
30
31
31
exports[`ssr should handle errors while streaming 1`] = `[Error: React.Children.only expected to receive a single React element child.]`;
32
32
33
33
exports[`ssr should interleave styles with rendered HTML when utilitizing streaming 1`] = `
34
- " <style data-styled=\\" true\\" data-styled-version =\\"JEST_MOCK_VERSION\\">.c{color:red;}
35
- data-styled.g1[id=\\"sc-b\\"]{content:\\"c,\\"}
36
- body{background:papayawhip;}
37
- data-styled.g2[id=\\"sc-global-a1\\"]{content:\\"sc-global-a1,\\"}
34
+ " <style data-styled=\\" true\\" data-styled-version =\\"JEST_MOCK_VERSION\\">.c{color:red;}/*!sc*/
35
+ data-styled.g1[id=\\"sc-b\\"]{content:\\"c,\\"}/*!sc*/
36
+ body{background:papayawhip;}/*!sc*/
37
+ data-styled.g2[id=\\"sc-global-a1\\"]{content:\\"sc-global-a1,\\"}/*!sc*/
38
38
</style><h1 class =\\"sc-b c\\">Hello SSR!</h1>"
39
39
`;
40
40
41
41
exports[`ssr should render CSS in the order the components were defined, not rendered 1`] = `"<div><h2 class =\\"TWO a\\"></h2><h1 class =\\"ONE b\\"></h1></div>"`;
42
42
43
43
exports[`ssr should render CSS in the order the components were defined, not rendered 2`] = `
44
- " <style data-styled=\\" true\\" data-styled-version =\\"JEST_MOCK_VERSION\\">.b{color:red;}
45
- data-styled.g1[id=\\"ONE\\"]{content:\\"b,\\"}
46
- .a{color:blue;}
47
- data-styled.g2[id=\\"TWO\\"]{content:\\"a,\\"}
44
+ " <style data-styled=\\" true\\" data-styled-version =\\"JEST_MOCK_VERSION\\">.b{color:red;}/*!sc*/
45
+ data-styled.g1[id=\\"ONE\\"]{content:\\"b,\\"}/*!sc*/
46
+ .a{color:blue;}/*!sc*/
47
+ data-styled.g2[id=\\"TWO\\"]{content:\\"a,\\"}/*!sc*/
48
48
</style>"
49
49
`;
50
50
51
51
exports[`ssr should return a generated React style element 1`] = `
52
52
Object {
53
53
" dangerouslySetInnerHTML" : Object {
54
- " __html" : " .c{color:red;}
55
- data - styled .g1 [id = \\" sc-b\\ " ]{content:\\" c,\\ " }
56
- body {background:papayawhip ;}
57
- data - styled .g2 [id = \\" sc-global-a1\\ " ]{content:\\" sc-global-a1,\\ " }
54
+ " __html" : " .c{color:red;}/*!sc* /
55
+ data - styled .g1 [id = \\" sc-b\\ " ]{content:\\" c,\\ " }/* !sc */
56
+ body {background:papayawhip ;}/* !sc */
57
+ data - styled .g2 [id = \\" sc-global-a1\\ " ]{content:\\" sc-global-a1,\\ " }/* !sc */
58
58
" ,
59
59
},
60
60
" data-styled" : " " ,
@@ -70,10 +70,10 @@ exports[`ssr should throw if getStyleElement is called after interleaveWithNodeS
70
70
`;
71
71
72
72
exports[`ssr should throw if getStyleElement is called after streaming is complete 1`] = `
73
- " <style data-styled=\\" true\\" data-styled-version =\\"JEST_MOCK_VERSION\\">.c{color:red;}
74
- data-styled.g1[id=\\"sc-b\\"]{content:\\"c,\\"}
75
- body{background:papayawhip;}
76
- data-styled.g2[id=\\"sc-global-a1\\"]{content:\\"sc-global-a1,\\"}
73
+ " <style data-styled=\\" true\\" data-styled-version =\\"JEST_MOCK_VERSION\\">.c{color:red;}/*!sc*/
74
+ data-styled.g1[id=\\"sc-b\\"]{content:\\"c,\\"}/*!sc*/
75
+ body{background:papayawhip;}/*!sc*/
76
+ data-styled.g2[id=\\"sc-global-a1\\"]{content:\\"sc-global-a1,\\"}/*!sc*/
77
77
</style><h1 class =\\"sc-b c\\">Hello SSR!</h1>"
78
78
`;
79
79
@@ -92,10 +92,10 @@ exports[`ssr should throw if getStyleTags is called after interleaveWithNodeStre
92
92
`;
93
93
94
94
exports[`ssr should throw if getStyleTags is called after streaming is complete 1`] = `
95
- " <style data-styled=\\" true\\" data-styled-version =\\"JEST_MOCK_VERSION\\">.c{color:red;}
96
- data-styled.g1[id=\\"sc-b\\"]{content:\\"c,\\"}
97
- body{background:papayawhip;}
98
- data-styled.g2[id=\\"sc-global-a1\\"]{content:\\"sc-global-a1,\\"}
95
+ " <style data-styled=\\" true\\" data-styled-version =\\"JEST_MOCK_VERSION\\">.c{color:red;}/*!sc*/
96
+ data-styled.g1[id=\\"sc-b\\"]{content:\\"c,\\"}/*!sc*/
97
+ body{background:papayawhip;}/*!sc*/
98
+ data-styled.g2[id=\\"sc-global-a1\\"]{content:\\"sc-global-a1,\\"}/*!sc*/
99
99
</style><h1 class =\\"sc-b c\\">Hello SSR!</h1>"
100
100
`;
101
101
0 commit comments