@@ -40,7 +40,7 @@ test('should render with correct content', async () => {
40
40
await wait ( )
41
41
42
42
const comp = document . querySelector ( 'nano-test2' )
43
- expect ( comp ?. shadowRoot ?. innerHTML ) . toEqual ( '<div><div> test text</div> </div>' )
43
+ expect ( comp ?. shadowRoot ?. innerHTML ) . toEqual ( '<div>test text</div>' )
44
44
expect ( spy ) . not . toHaveBeenCalled ( )
45
45
} )
46
46
@@ -65,7 +65,7 @@ test('should render with props', async () => {
65
65
await wait ( )
66
66
67
67
const comp = document . querySelector ( 'nano-test3' )
68
- expect ( comp ?. shadowRoot ?. innerHTML ) . toEqual ( '<div><div> test : fuga</div> </div>' )
68
+ expect ( comp ?. shadowRoot ?. innerHTML ) . toEqual ( '<div>test : fuga</div>' )
69
69
expect ( spy ) . not . toHaveBeenCalled ( )
70
70
} )
71
71
@@ -90,11 +90,11 @@ test('should update render result with props change', async () => {
90
90
await wait ( )
91
91
92
92
const comp = document . querySelector ( 'nano-test4' )
93
- expect ( comp ?. shadowRoot ?. innerHTML ) . toEqual ( '<div><div> test : fuga</div> </div>' )
93
+ expect ( comp ?. shadowRoot ?. innerHTML ) . toEqual ( '<div>test : fuga</div>' )
94
94
95
95
document . body . innerHTML = '<nano-test4 value="hoge"></nano-test4>'
96
96
const compChanged = document . querySelector ( 'nano-test4' )
97
- expect ( compChanged ?. shadowRoot ?. innerHTML ) . toEqual ( '<div><div> test : hoge</div> </div>' )
97
+ expect ( compChanged ?. shadowRoot ?. innerHTML ) . toEqual ( '<div>test : hoge</div>' )
98
98
expect ( spy ) . not . toHaveBeenCalled ( )
99
99
} )
100
100
@@ -123,10 +123,10 @@ test('should change render result with state change', async () => {
123
123
await wait ( )
124
124
125
125
const comp = document . querySelector ( 'nano-test5' )
126
- expect ( comp ?. shadowRoot ?. innerHTML ) . toEqual ( '<div><div><div> Counter: 0</div><button>Increment</button></div ></div>' )
126
+ expect ( comp ?. shadowRoot ?. innerHTML ) . toEqual ( '<div><div>Counter: 0</div><button>Increment</button></div>' )
127
127
128
128
comp ?. shadowRoot ?. querySelector ( 'button' ) ?. click ( )
129
- expect ( comp ?. shadowRoot ?. innerHTML ) . toEqual ( '<div><div><div> Counter: 1</div><button>Increment</button></div ></div>' )
129
+ expect ( comp ?. shadowRoot ?. innerHTML ) . toEqual ( '<div><div>Counter: 1</div><button>Increment</button></div>' )
130
130
expect ( spy ) . not . toHaveBeenCalled ( )
131
131
} )
132
132
@@ -163,17 +163,17 @@ test('should keep state with props change', async () => {
163
163
164
164
const comp = document . querySelector ( 'nano-test6' )
165
165
expect ( comp ?. shadowRoot ?. innerHTML ) . toEqual (
166
- '<div><div><div> Counter: 0</div><div>props: 1</div><button>Increment</button></div ></div>'
166
+ '<div><div>Counter: 0</div><div>props: 1</div><button>Increment</button></div>'
167
167
)
168
168
169
169
comp ?. shadowRoot ?. querySelector ( 'button' ) ?. click ( )
170
170
expect ( comp ?. shadowRoot ?. innerHTML ) . toEqual (
171
- '<div><div><div> Counter: 1</div><div>props: 1</div><button>Increment</button></div ></div>'
171
+ '<div><div>Counter: 1</div><div>props: 1</div><button>Increment</button></div>'
172
172
)
173
173
// @ts -ignore
174
174
comp . attributes . value ?. value = 2
175
175
expect ( comp ?. shadowRoot ?. innerHTML ) . toEqual (
176
- '<div><div><div> Counter: 1</div><div>props: 2</div><button>Increment</button></div ></div>'
176
+ '<div><div>Counter: 1</div><div>props: 2</div><button>Increment</button></div>'
177
177
)
178
178
expect ( spy ) . not . toHaveBeenCalled ( )
179
179
} )
@@ -190,10 +190,10 @@ test('should render also with functional component', async () => {
190
190
await wait ( )
191
191
192
192
const comp = document . querySelector ( 'nano-test7' )
193
- expect ( comp ?. shadowRoot ?. innerHTML ) . toEqual ( '<div>< p>hoge</p></div >' )
193
+ expect ( comp ?. shadowRoot ?. innerHTML ) . toEqual ( '<p>hoge</p>' )
194
194
// @ts -ignore
195
195
comp . attributes . value ?. value = 'bar'
196
- expect ( comp ?. shadowRoot ?. innerHTML ) . toEqual ( '<div>< p>bar</p></div >' )
196
+ expect ( comp ?. shadowRoot ?. innerHTML ) . toEqual ( '<p>bar</p>' )
197
197
expect ( spy ) . not . toHaveBeenCalled ( )
198
198
} )
199
199
@@ -225,6 +225,6 @@ test('should render also with slot', async () => {
225
225
await wait ( )
226
226
227
227
const comp = document . querySelector ( 'nano-test8' )
228
- expect ( comp ?. shadowRoot ?. innerHTML ) . toEqual ( '<div><div>< header>nano jsx</header><main><p>hoge</p></main></div ></div>' )
228
+ expect ( comp ?. shadowRoot ?. innerHTML ) . toEqual ( '<div><header>nano jsx</header><main><p>hoge</p></main></div>' )
229
229
expect ( spy ) . not . toHaveBeenCalled ( )
230
230
} )
0 commit comments