@@ -79,7 +79,7 @@ export default class Wrapper implements BaseWrapper {
79
79
}
80
80
81
81
if ( selectorType === selectorTypes . OPTIONS_OBJECT ) {
82
- if ( ! this . isVueComponent ) {
82
+ if ( ! this . vm ) {
83
83
throwError ( '$ref selectors can only be used on Vue component wrappers' )
84
84
}
85
85
const nodes = findVNodesByRef ( this . vnode , selector . ref )
@@ -96,7 +96,7 @@ export default class Wrapper implements BaseWrapper {
96
96
/**
97
97
* Returns an object containing custom events emitted by the Wrapper vm
98
98
*/
99
- emitted ( event : ? string ) {
99
+ emitted ( event ?: string ) {
100
100
if ( ! this . _emitted && ! this . vm ) {
101
101
throwError ( 'wrapper . emitted ( ) can only be called on a Vue instance ')
102
102
}
@@ -120,7 +120,7 @@ export default class Wrapper implements BaseWrapper {
120
120
* Utility to check wrapper exists. Returns true as Wrapper always exists
121
121
*/
122
122
exists ( ) : boolean {
123
- if ( this . isVueComponent ) {
123
+ if ( this . vm ) {
124
124
return ! ! this . vm && ! this . vm . _isDestroyed
125
125
}
126
126
return true
@@ -241,7 +241,7 @@ export default class Wrapper implements BaseWrapper {
241
241
}
242
242
243
243
if ( selectorType === selectorTypes . OPTIONS_OBJECT ) {
244
- if ( ! this . isVueComponent ) {
244
+ if ( ! this . vm ) {
245
245
throwError ( '$ref selectors can only be used on Vue component wrappers' )
246
246
}
247
247
if ( this . vm && this . vm . $refs && selector . ref in this . vm . $refs && this . vm . $refs [ selector . ref ] instanceof Vue ) {
@@ -278,7 +278,7 @@ export default class Wrapper implements BaseWrapper {
278
278
}
279
279
280
280
if ( selectorType === selectorTypes . OPTIONS_OBJECT ) {
281
- if ( ! this . isVueComponent ) {
281
+ if ( ! this . vm ) {
282
282
throwError ( '$ref selectors can only be used on Vue component wrappers' )
283
283
}
284
284
if ( this . vm && this . vm . $refs && selector . ref in this . vm . $refs && this . vm . $refs [ selector . ref ] instanceof Vue ) {
@@ -311,7 +311,7 @@ export default class Wrapper implements BaseWrapper {
311
311
is ( selector : Selector ) : boolean {
312
312
const selectorType = getSelectorTypeOrThrow ( selector , 'is' )
313
313
314
- if ( selectorType === selectorTypes . VUE_COMPONENT && this . isVueComponent ) {
314
+ if ( selectorType === selectorTypes . VUE_COMPONENT && this . vm ) {
315
315
if ( typeof selector . name !== 'string' ) {
316
316
throwError ( 'a Component used as a selector must have a name property' )
317
317
}
@@ -349,7 +349,7 @@ export default class Wrapper implements BaseWrapper {
349
349
* Returns name of component, or tag name if node is not a Vue component
350
350
*/
351
351
name ( ) : string {
352
- if ( this . isVueComponent && this . vm ) {
352
+ if ( this . vm ) {
353
353
return this . vm . $options . name
354
354
}
355
355
@@ -360,7 +360,7 @@ export default class Wrapper implements BaseWrapper {
360
360
* Returns an Object containing the prop name/value pairs on the element
361
361
*/
362
362
props ( ) : { [ name : string ] : any } {
363
- if ( ! this . isVueComponent ) {
363
+ if ( ! this . vm ) {
364
364
throwError ( 'wrapper.props() must be called on a Vue instance' )
365
365
}
366
366
// $props object does not exist in Vue 2.1.x, so use $options.propsData instead
@@ -378,7 +378,7 @@ export default class Wrapper implements BaseWrapper {
378
378
* Sets vm data
379
379
*/
380
380
setData ( data : Object ) {
381
- if ( ! this . isVueComponent ) {
381
+ if ( ! this . vm ) {
382
382
throwError ( 'wrapper.setData() can only be called on a Vue instance' )
383
383
}
384
384
0 commit comments