Skip to content

Commit

Permalink
test: reenable expose test
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Dec 9, 2023
1 parent 75b7021 commit 204037e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
4 changes: 3 additions & 1 deletion examples/app-vitest-full/components/WrapperTests.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@ function testExpose () {
return 'expose was successful'
}
const someRef = ref('thing')
const modelValue = defineModel({ default: false })
defineExpose({
testExpose,
someRef: ref('thing')
someRef
})
</script>

Expand Down
10 changes: 5 additions & 5 deletions examples/app-vitest-full/tests/nuxt/mount-suspended.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,18 +95,18 @@ describe('mountSuspended', () => {
expect(component.emitted()).toHaveProperty('update:modelValue')
})

// TODO: fix this failing test
// FIXME: fix this failing test
it.todo('can receive emitted events from components mounted within nuxt suspense using defineModel', async () => {
const component = await mountSuspended(WrapperTests)
component.find('button#changeModelValue').trigger('click')
expect(component.emitted()).toHaveProperty('update:modelValue')
})

// TODO: fix this failing test
it.todo('can access exposed methods/refs from components mounted within nuxt suspense', async () => {
it('can access exposed methods/refs from components mounted within nuxt suspense', async () => {
const component = await mountSuspended(WrapperTests)
expect(component.vm.testExpose?.()).toBe('thing')
expect(component.vm.someRef).toBe('thing')
expect(component.vm.testExpose?.()).toBe('expose was successful')
// @ts-expect-error FIXME: someRef is typed as unwrapped
expect(component.vm.someRef.value).toBe('thing')
})
})

Expand Down

0 comments on commit 204037e

Please sign in to comment.