Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
ci: add test case to fix #311
  • Loading branch information
hcg1023 committed Mar 7, 2024
commit 000b3e839014a5d6f3effa1c9ed452598baf6767
24 changes: 11 additions & 13 deletions src/__tests__/render.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,24 +90,22 @@ test('unmounts', () => {
})

test('use unmount before cleanup', () => {
const ChildComponent = defineComponent(() => {
return () =>
h(
'div',
{
'data-testid': 'node',
},
['Hi'],
)
})

const ParentComponent = defineComponent((_, {slots}) => {
const TestComponent = defineComponent((_, {slots}) => {
return () => slots.default?.()
})

const {getByTestId, unmount, queryByTestId} = render({
render() {
return h(ParentComponent, {}, {default: () => h(ChildComponent)})
return h(
TestComponent,
{},
{
default: () =>
h('div', {
'data-testid': 'node',
}),
},
)
},
})

Expand Down