Skip to content

Commit

Permalink
fix(keep-alive): add test case
Browse files Browse the repository at this point in the history
  • Loading branch information
张东 authored and 张东 committed Aug 12, 2024
1 parent 12afb29 commit f8ce9d6
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions packages/runtime-core/__tests__/components/KeepAlive.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,16 @@ describe('KeepAlive', () => {
await nextTick()
assertHookCalls(one, [2, 2, 1, 1, 1])
assertHookCalls(two, [1, 1, 1, 1, 0])

excludeRef.value = ''
await nextTick()
assertHookCalls(one, [2, 2, 1, 1, 1])
assertHookCalls(two, [1, 1, 1, 1, 0])

excludeRef.value = 'two'
await nextTick()
assertHookCalls(one, [2, 2, 1, 1, 1])
assertHookCalls(two, [1, 1, 1, 1, 1])
})

test('on include change + view switch', async () => {
Expand Down

0 comments on commit f8ce9d6

Please sign in to comment.