File tree Expand file tree Collapse file tree 2 files changed +8
-6
lines changed
Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -8,11 +8,13 @@ function testExpose () {
88 return ' expose was successful'
99}
1010
11+ const someRef = ref (' thing' )
12+
1113const modelValue = defineModel ({ default: false })
1214
1315defineExpose ({
1416 testExpose ,
15- someRef: ref ( ' thing ' )
17+ someRef
1618})
1719 </script >
1820
Original file line number Diff line number Diff line change @@ -95,18 +95,18 @@ describe('mountSuspended', () => {
9595 expect ( component . emitted ( ) ) . toHaveProperty ( 'update:modelValue' )
9696 } )
9797
98- // TODO : fix this failing test
98+ // FIXME : fix this failing test
9999 it . todo ( 'can receive emitted events from components mounted within nuxt suspense using defineModel' , async ( ) => {
100100 const component = await mountSuspended ( WrapperTests )
101101 component . find ( 'button#changeModelValue' ) . trigger ( 'click' )
102102 expect ( component . emitted ( ) ) . toHaveProperty ( 'update:modelValue' )
103103 } )
104104
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 ( ) => {
107106 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' )
110110 } )
111111} )
112112
You can’t perform that action at this time.
0 commit comments