|
3 | 3 | exports[`Children prop reactivity > should NOT make arrow function children reactive (functions are static) 1`] = ` |
4 | 4 | "import { component, html } from "kaori.js"; |
5 | 5 | function Parent() { |
6 | | - return component(For, { |
| 6 | + return html\`\${component(For, { |
7 | 7 | get items() { |
8 | 8 | return getItems(); |
9 | 9 | }, |
10 | 10 | children: item => html\`<div>\${item.name}</div>\` |
11 | | - }); |
| 11 | + })}\`; |
12 | 12 | }" |
13 | 13 | `; |
14 | 14 |
|
15 | 15 | exports[`Children prop reactivity > should NOT make children reactive when containing only static content 1`] = ` |
16 | 16 | "import { component, html } from "kaori.js"; |
17 | 17 | function Parent() { |
18 | | - return component(Container, { |
| 18 | + return html\`\${component(Container, { |
19 | 19 | children: html\`<p>Static text</p>\` |
20 | | - }); |
| 20 | + })}\`; |
21 | 21 | }" |
22 | 22 | `; |
23 | 23 |
|
24 | 24 | exports[`Children prop reactivity > should handle nested reactive children correctly 1`] = ` |
25 | | -"import { component } from "kaori.js"; |
| 25 | +"import { component, html } from "kaori.js"; |
26 | 26 | function Parent() { |
27 | | - return component(Outer, { |
| 27 | + return html\`\${component(Outer, { |
28 | 28 | get children() { |
29 | | - return component(Middle, { |
| 29 | + return html\`\${component(Middle, { |
30 | 30 | get children() { |
31 | | - return component(Inner, { |
| 31 | + return html\`\${component(Inner, { |
32 | 32 | get prop() { |
33 | 33 | return getValue(); |
34 | 34 | } |
35 | | - }); |
| 35 | + })}\`; |
36 | 36 | } |
37 | | - }); |
| 37 | + })}\`; |
38 | 38 | } |
39 | | - }); |
| 39 | + })}\`; |
40 | 40 | }" |
41 | 41 | `; |
42 | 42 |
|
43 | 43 | exports[`Children prop reactivity > should make children reactive even with static component props (component call is dynamic) 1`] = ` |
44 | | -"import { component } from "kaori.js"; |
| 44 | +"import { component, html } from "kaori.js"; |
45 | 45 | function Parent() { |
46 | | - return component(Container, { |
| 46 | + return html\`\${component(Container, { |
47 | 47 | get children() { |
48 | | - return component(Child, { |
| 48 | + return html\`\${component(Child, { |
49 | 49 | title: "static" |
50 | | - }); |
| 50 | + })}\`; |
51 | 51 | } |
52 | | - }); |
| 52 | + })}\`; |
53 | 53 | }" |
54 | 54 | `; |
55 | 55 |
|
56 | 56 | exports[`Children prop reactivity > should make children reactive when containing component with function call props 1`] = ` |
57 | | -"import { component } from "kaori.js"; |
| 57 | +"import { component, html } from "kaori.js"; |
58 | 58 | function Parent() { |
59 | | - return component(Container, { |
| 59 | + return html\`\${component(Container, { |
60 | 60 | get children() { |
61 | | - return component(Child, { |
| 61 | + return html\`\${component(Child, { |
62 | 62 | get title() { |
63 | 63 | return getTitle(); |
64 | 64 | } |
65 | | - }); |
| 65 | + })}\`; |
66 | 66 | } |
67 | | - }); |
| 67 | + })}\`; |
68 | 68 | }" |
69 | 69 | `; |
70 | 70 |
|
71 | 71 | exports[`Children prop reactivity > should make children reactive when containing function calls 1`] = ` |
72 | | -"import { component } from "kaori.js"; |
| 72 | +"import { component, html } from "kaori.js"; |
73 | 73 | function Parent() { |
74 | | - return component(Container, { |
| 74 | + return html\`\${component(Container, { |
75 | 75 | get children() { |
76 | 76 | return getMessage(); |
77 | 77 | } |
78 | | - }); |
| 78 | + })}\`; |
79 | 79 | }" |
80 | 80 | `; |
81 | 81 |
|
82 | 82 | exports[`Children prop reactivity > should make children reactive when containing html template with member access 1`] = ` |
83 | 83 | "import { component, html } from "kaori.js"; |
84 | 84 | function Parent() { |
85 | | - return component(Container, { |
| 85 | + return html\`\${component(Container, { |
86 | 86 | get children() { |
87 | 87 | return html\`<p>\${user.name}</p>\`; |
88 | 88 | } |
89 | | - }); |
| 89 | + })}\`; |
90 | 90 | }" |
91 | 91 | `; |
92 | 92 |
|
93 | 93 | exports[`Children prop reactivity > should make children reactive when containing member access 1`] = ` |
94 | | -"import { component } from "kaori.js"; |
| 94 | +"import { component, html } from "kaori.js"; |
95 | 95 | function Parent() { |
96 | | - return component(Container, { |
| 96 | + return html\`\${component(Container, { |
97 | 97 | get children() { |
98 | 98 | return user.name; |
99 | 99 | } |
100 | | - }); |
| 100 | + })}\`; |
101 | 101 | }" |
102 | 102 | `; |
103 | 103 |
|
104 | 104 | exports[`Children prop reactivity > should make children reactive with mixed static and dynamic content 1`] = ` |
105 | 105 | "import { component, html } from "kaori.js"; |
106 | 106 | function Parent() { |
107 | | - return component(Container, { |
| 107 | + return html\`\${component(Container, { |
108 | 108 | get children() { |
109 | | - return [html\`<p>Static</p>\`, getDynamic(), component(Child, { |
| 109 | + return [html\`<p>Static</p>\`, getDynamic(), html\`\${component(Child, { |
110 | 110 | get prop() { |
111 | 111 | return getValue(); |
112 | 112 | } |
113 | | - })]; |
| 113 | + })}\`]; |
114 | 114 | } |
115 | | - }); |
| 115 | + })}\`; |
116 | 116 | }" |
117 | 117 | `; |
0 commit comments