@@ -837,7 +837,7 @@ describe('defineCustomElement', () => {
837
837
838
838
describe ( 'styles' , ( ) => {
839
839
function assertStyles ( el : VueElement , css : string [ ] ) {
840
- const styles = el . shadowRoot ?. querySelectorAll ( 'style' ) !
840
+ const styles = el . shadowRoot ?. querySelectorAll ( 'style' )
841
841
expect ( styles . length ) . toBe ( css . length ) // should not duplicate multiple copies from Bar
842
842
for ( let i = 0 ; i < css . length ; i ++ ) {
843
843
expect ( styles [ i ] . textContent ) . toBe ( css [ i ] )
@@ -856,7 +856,7 @@ describe('defineCustomElement', () => {
856
856
customElements . define ( 'my-el-with-styles' , Foo )
857
857
container . innerHTML = `<my-el-with-styles></my-el-with-styles>`
858
858
const el = container . childNodes [ 0 ] as VueElement
859
- const style = el . shadowRoot ?. querySelector ( 'style' ) !
859
+ const style = el . shadowRoot ?. querySelector ( 'style' )
860
860
expect ( style . textContent ) . toBe ( `div { color: red; }` )
861
861
862
862
// hmr
@@ -953,7 +953,7 @@ describe('defineCustomElement', () => {
953
953
customElements . define ( 'my-el-with-nonce' , Foo )
954
954
container . innerHTML = `<my-el-with-nonce></my-el-with-nonce>`
955
955
const el = container . childNodes [ 0 ] as VueElement
956
- const style = el . shadowRoot ?. querySelector ( 'style' ) !
956
+ const style = el . shadowRoot ?. querySelector ( 'style' )
957
957
expect ( style . getAttribute ( 'nonce' ) ) . toBe ( 'xxx' )
958
958
} )
959
959
} )
@@ -1396,7 +1396,7 @@ describe('defineCustomElement', () => {
1396
1396
customElements . define ( 'my-el-use-shadow-root' , Foo )
1397
1397
container . innerHTML = `<my-el-use-shadow-root>`
1398
1398
const el = container . childNodes [ 0 ] as VueElement
1399
- const style = el . shadowRoot ?. querySelector ( 'style' ) !
1399
+ const style = el . shadowRoot ?. querySelector ( 'style' )
1400
1400
expect ( style . textContent ) . toBe ( `div { color: red; }` )
1401
1401
} )
1402
1402
} )
0 commit comments