-
Notifications
You must be signed in to change notification settings - Fork 108
Closed
Labels
Description
Describe the feature
Problem
Currently, vm in mountSuspended() does not automatically unwrap refs, which is inconsistent with vue/test-utils:
// Current behavior (inconsistent)
const component = await mountSuspended(SomeComponent)
console.log(component.vm.someRef) // Returns ref object, not the value
console.log(component.vm.someRef.value) // Need to manually access .value
// Expected behavior (vue/test-utils)
const wrapper = mount(SomeComponent)
console.log(wrapper.vm.someRef) // Returns unwrapped valueExpected Behavior
wrapper.vm should automatically unwrap refs to match vue/test-utils:
const component = await mountSuspended(SomeComponent)
expect(component.vm.someRef).toBe('thing') // Should work directly
component.vm.someRef = 'new thing' // Should update ref.value
expect(component.vm.someRef).toBe('new thing') // Should reflect changesAdditional information
- Would you be willing to help implement this feature?
- Could this feature be implemented as a module?
Final checks
- Read the contribution guide.
- Check existing discussions and issues.