File tree 2 files changed +8
-6
lines changed
2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -8,11 +8,13 @@ function testExpose () {
8
8
return ' expose was successful'
9
9
}
10
10
11
+ const someRef = ref (' thing' )
12
+
11
13
const modelValue = defineModel ({ default: false })
12
14
13
15
defineExpose ({
14
16
testExpose ,
15
- someRef: ref ( ' thing ' )
17
+ someRef
16
18
})
17
19
</script >
18
20
Original file line number Diff line number Diff line change @@ -95,18 +95,18 @@ describe('mountSuspended', () => {
95
95
expect ( component . emitted ( ) ) . toHaveProperty ( 'update:modelValue' )
96
96
} )
97
97
98
- // TODO : fix this failing test
98
+ // FIXME : fix this failing test
99
99
it . todo ( 'can receive emitted events from components mounted within nuxt suspense using defineModel' , async ( ) => {
100
100
const component = await mountSuspended ( WrapperTests )
101
101
component . find ( 'button#changeModelValue' ) . trigger ( 'click' )
102
102
expect ( component . emitted ( ) ) . toHaveProperty ( 'update:modelValue' )
103
103
} )
104
104
105
- // TODO: fix this failing test
106
- it . todo ( 'can access exposed methods/refs from components mounted within nuxt suspense' , async ( ) => {
105
+ it ( 'can access exposed methods/refs from components mounted within nuxt suspense' , async ( ) => {
107
106
const component = await mountSuspended ( WrapperTests )
108
- expect ( component . vm . testExpose ?.( ) ) . toBe ( 'thing' )
109
- expect ( component . vm . someRef ) . toBe ( 'thing' )
107
+ expect ( component . vm . testExpose ?.( ) ) . toBe ( 'expose was successful' )
108
+ // @ts -expect-error FIXME: someRef is typed as unwrapped
109
+ expect ( component . vm . someRef . value ) . toBe ( 'thing' )
110
110
} )
111
111
} )
112
112
You can’t perform that action at this time.
0 commit comments