Skip to content

Commit 204037e

Browse files
committedDec 9, 2023
test: reenable expose test
1 parent 75b7021 commit 204037e

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed
 

‎examples/app-vitest-full/components/WrapperTests.vue

+3-1
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,13 @@ function testExpose () {
88
return 'expose was successful'
99
}
1010
11+
const someRef = ref('thing')
12+
1113
const modelValue = defineModel({ default: false })
1214
1315
defineExpose({
1416
testExpose,
15-
someRef: ref('thing')
17+
someRef
1618
})
1719
</script>
1820

‎examples/app-vitest-full/tests/nuxt/mount-suspended.spec.ts

+5-5
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)
Please sign in to comment.