@@ -32,6 +32,7 @@ test('COMPILER_IS_ON_ELEMENT', () => {
32
32
}
33
33
} ) . $mount ( )
34
34
35
+ expect ( vm . $el ) . toBeInstanceOf ( HTMLDivElement )
35
36
expect ( vm . $el . outerHTML ) . toBe ( `<div>text</div>` )
36
37
expect ( CompilerDeprecationTypes . COMPILER_IS_ON_ELEMENT ) . toHaveBeenWarned ( )
37
38
} )
@@ -48,6 +49,7 @@ test('COMPILER_IS_ON_ELEMENT (dynamic)', () => {
48
49
}
49
50
} ) . $mount ( )
50
51
52
+ expect ( vm . $el ) . toBeInstanceOf ( HTMLDivElement )
51
53
expect ( vm . $el . outerHTML ) . toBe ( `<div>text</div>` )
52
54
expect ( CompilerDeprecationTypes . COMPILER_IS_ON_ELEMENT ) . toHaveBeenWarned ( )
53
55
} )
@@ -70,9 +72,10 @@ test('COMPILER_V_BIND_SYNC', async () => {
70
72
}
71
73
} ) . $mount ( )
72
74
75
+ expect ( vm . $el ) . toBeInstanceOf ( HTMLButtonElement )
73
76
expect ( vm . $el . textContent ) . toBe ( `0` )
74
77
75
- triggerEvent ( vm . $el , 'click' )
78
+ triggerEvent ( vm . $el as Element , 'click' )
76
79
await nextTick ( )
77
80
expect ( vm . $el . textContent ) . toBe ( `1` )
78
81
@@ -83,6 +86,8 @@ test('COMPILER_V_BIND_PROP', () => {
83
86
const vm = new Vue ( {
84
87
template : `<div :id.prop="'foo'"/>`
85
88
} ) . $mount ( )
89
+
90
+ expect ( vm . $el ) . toBeInstanceOf ( HTMLDivElement )
86
91
expect ( vm . $el . id ) . toBe ( 'foo' )
87
92
expect ( CompilerDeprecationTypes . COMPILER_V_BIND_PROP ) . toHaveBeenWarned ( )
88
93
} )
@@ -91,6 +96,7 @@ test('COMPILER_V_BIND_OBJECT_ORDER', () => {
91
96
const vm = new Vue ( {
92
97
template : `<div id="foo" v-bind="{ id: 'bar', class: 'baz' }" />`
93
98
} ) . $mount ( )
99
+ expect ( vm . $el ) . toBeInstanceOf ( HTMLDivElement )
94
100
expect ( vm . $el . id ) . toBe ( 'foo' )
95
101
expect ( vm . $el . className ) . toBe ( 'baz' )
96
102
expect (
@@ -112,7 +118,8 @@ test('COMPILER_V_ON_NATIVE', () => {
112
118
}
113
119
} ) . $mount ( )
114
120
115
- triggerEvent ( vm . $el , 'click' )
121
+ expect ( vm . $el ) . toBeInstanceOf ( HTMLButtonElement )
122
+ triggerEvent ( vm . $el as HTMLButtonElement , 'click' )
116
123
expect ( spy ) . toHaveBeenCalledTimes ( 1 )
117
124
expect ( CompilerDeprecationTypes . COMPILER_V_ON_NATIVE ) . toHaveBeenWarned ( )
118
125
} )
@@ -128,6 +135,8 @@ test('COMPILER_NATIVE_TEMPLATE', () => {
128
135
const vm = new Vue ( {
129
136
template : `<div><template><div/></template></div>`
130
137
} ) . $mount ( )
138
+
139
+ expect ( vm . $el ) . toBeInstanceOf ( HTMLDivElement )
131
140
expect ( vm . $el . innerHTML ) . toBe ( `<div></div>` )
132
141
expect ( CompilerDeprecationTypes . COMPILER_NATIVE_TEMPLATE ) . toHaveBeenWarned ( )
133
142
} )
@@ -144,6 +153,7 @@ test('COMPILER_INLINE_TEMPLATE', () => {
144
153
}
145
154
} ) . $mount ( )
146
155
147
- expect ( vm . $el . outerHTML ) . toBe ( `<div>123</div>` )
156
+ expect ( vm . $el ) . toBeInstanceOf ( HTMLDivElement )
157
+ expect ( vm . $el ?. outerHTML ) . toBe ( `<div>123</div>` )
148
158
expect ( CompilerDeprecationTypes . COMPILER_INLINE_TEMPLATE ) . toHaveBeenWarned ( )
149
159
} )
0 commit comments