@@ -17,15 +17,15 @@ describe('Component children', () => {
17
17
18
18
// test 1: Can pass text to Preact components
19
19
const $preact = $ ( '#preact' ) ;
20
- assert . strictEqual ( $preact . text ( ) . trim ( ) , 'Hello world' ) ;
20
+ assert . equal ( $preact . text ( ) . trim ( ) , 'Hello world' ) ;
21
21
22
22
// test 2: Can pass text to Vue components
23
23
const $vue = $ ( '#vue' ) ;
24
- assert . strictEqual ( $vue . text ( ) . trim ( ) , 'Hello world' ) ;
24
+ assert . equal ( $vue . text ( ) . trim ( ) , 'Hello world' ) ;
25
25
26
26
// test 3: Can pass text to Svelte components
27
27
const $svelte = $ ( '#svelte' ) ;
28
- assert . strictEqual ( $svelte . text ( ) . trim ( ) , 'Hello world' ) ;
28
+ assert . equal ( $svelte . text ( ) . trim ( ) , 'Hello world' ) ;
29
29
} ) ;
30
30
31
31
it ( 'Passes markup children to framework components' , async ( ) => {
@@ -34,15 +34,15 @@ describe('Component children', () => {
34
34
35
35
// test 1: Can pass markup to Preact components
36
36
const $preact = $ ( '#preact h1' ) ;
37
- assert . strictEqual ( $preact . text ( ) . trim ( ) , 'Hello world' ) ;
37
+ assert . equal ( $preact . text ( ) . trim ( ) , 'Hello world' ) ;
38
38
39
39
// test 2: Can pass markup to Vue components
40
40
const $vue = $ ( '#vue h1' ) ;
41
- assert . strictEqual ( $vue . text ( ) . trim ( ) , 'Hello world' ) ;
41
+ assert . equal ( $vue . text ( ) . trim ( ) , 'Hello world' ) ;
42
42
43
43
// test 3: Can pass markup to Svelte components
44
44
const $svelte = $ ( '#svelte h1' ) ;
45
- assert . strictEqual ( $svelte . text ( ) . trim ( ) , 'Hello world' ) ;
45
+ assert . equal ( $svelte . text ( ) . trim ( ) , 'Hello world' ) ;
46
46
} ) ;
47
47
48
48
it ( 'Passes multiple children to framework components' , async ( ) => {
@@ -51,48 +51,48 @@ describe('Component children', () => {
51
51
52
52
// test 1: Can pass multiple children to Preact components
53
53
const $preact = $ ( '#preact' ) ;
54
- assert . strictEqual ( $preact . children ( ) . length , 2 ) ;
55
- assert . strictEqual ( $preact . children ( ':first-child' ) . text ( ) . trim ( ) , 'Hello world' ) ;
56
- assert . strictEqual ( $preact . children ( ':last-child' ) . text ( ) . trim ( ) , 'Goodbye world' ) ;
54
+ assert . equal ( $preact . children ( ) . length , 2 ) ;
55
+ assert . equal ( $preact . children ( ':first-child' ) . text ( ) . trim ( ) , 'Hello world' ) ;
56
+ assert . equal ( $preact . children ( ':last-child' ) . text ( ) . trim ( ) , 'Goodbye world' ) ;
57
57
58
58
// test 2: Can pass multiple children to Vue components
59
59
const $vue = $ ( '#vue' ) ;
60
- assert . strictEqual ( $vue . children ( ) . length , 2 ) ;
61
- assert . strictEqual ( $vue . children ( ':first-child' ) . text ( ) . trim ( ) , 'Hello world' ) ;
62
- assert . strictEqual ( $vue . children ( ':last-child' ) . text ( ) . trim ( ) , 'Goodbye world' ) ;
60
+ assert . equal ( $vue . children ( ) . length , 2 ) ;
61
+ assert . equal ( $vue . children ( ':first-child' ) . text ( ) . trim ( ) , 'Hello world' ) ;
62
+ assert . equal ( $vue . children ( ':last-child' ) . text ( ) . trim ( ) , 'Goodbye world' ) ;
63
63
64
64
// test 3: Can pass multiple children to Svelte components
65
65
const $svelte = $ ( '#svelte' ) ;
66
- assert . strictEqual ( $svelte . children ( ) . length , 2 ) ;
67
- assert . strictEqual ( $svelte . children ( ':first-child' ) . text ( ) . trim ( ) , 'Hello world' ) ;
68
- assert . strictEqual ( $svelte . children ( ':last-child' ) . text ( ) . trim ( ) , 'Goodbye world' ) ;
66
+ assert . equal ( $svelte . children ( ) . length , 2 ) ;
67
+ assert . equal ( $svelte . children ( ':first-child' ) . text ( ) . trim ( ) , 'Hello world' ) ;
68
+ assert . equal ( $svelte . children ( ':last-child' ) . text ( ) . trim ( ) , 'Goodbye world' ) ;
69
69
} ) ;
70
70
71
71
it ( 'Renders a template when children are not rendered for client components' , async ( ) => {
72
72
const html = await fixture . readFile ( '/no-render/index.html' ) ;
73
73
const $ = cheerio . load ( html ) ;
74
74
75
75
// test 1: If SSR only, no children are rendered.
76
- assert . strictEqual ( $ ( '#ssr-only' ) . children ( ) . length , 0 ) ;
76
+ assert . equal ( $ ( '#ssr-only' ) . children ( ) . length , 0 ) ;
77
77
78
78
// test 2: If client, and no children are rendered, a template is.
79
- assert . strictEqual (
79
+ assert . equal (
80
80
$ ( '#client' ) . parent ( ) . children ( ) . length ,
81
81
2 ,
82
82
'rendered the client component and a template'
83
83
) ;
84
- assert . strictEqual (
84
+ assert . equal (
85
85
$ ( '#client' ) . parent ( ) . find ( 'template[data-astro-template]' ) . length ,
86
86
1 ,
87
87
'Found 1 template'
88
88
) ;
89
89
90
90
// test 3: If client, and children are rendered, no template is.
91
- assert . strictEqual ( $ ( '#client-render' ) . parent ( ) . children ( ) . length , 1 ) ;
92
- assert . strictEqual ( $ ( '#client-render' ) . parent ( ) . find ( 'template' ) . length , 0 ) ;
91
+ assert . equal ( $ ( '#client-render' ) . parent ( ) . children ( ) . length , 1 ) ;
92
+ assert . equal ( $ ( '#client-render' ) . parent ( ) . find ( 'template' ) . length , 0 ) ;
93
93
94
94
// test 4: If client and no children are provided, no template is.
95
- assert . strictEqual ( $ ( '#client-no-children' ) . parent ( ) . children ( ) . length , 1 ) ;
96
- assert . strictEqual ( $ ( '#client-no-children' ) . parent ( ) . find ( 'template' ) . length , 0 ) ;
95
+ assert . equal ( $ ( '#client-no-children' ) . parent ( ) . children ( ) . length , 1 ) ;
96
+ assert . equal ( $ ( '#client-no-children' ) . parent ( ) . find ( 'template' ) . length , 0 ) ;
97
97
} ) ;
98
98
} ) ;
0 commit comments