fix: key AppSheet render branches and self-heal never-mounted component vnodes
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { afterEach, describe, expect, it, vi } from 'vitest'
|
||||
import { readFileSync } from 'node:fs'
|
||||
import { createApp, h, nextTick, ref } from 'vue'
|
||||
import AppSheet from './AppSheet.vue'
|
||||
import AppDialog from './AppDialog.vue'
|
||||
@@ -273,4 +274,11 @@ describe('AppSheet', () => {
|
||||
await nextTick()
|
||||
expect(calls).toEqual(['two'])
|
||||
})
|
||||
|
||||
it('keys each render branch so modal/inline/bare switches remount instead of cross-patching', () => {
|
||||
const source = readFileSync('src/components/AppSheet.vue', 'utf8')
|
||||
expect(source).toContain(`:key="'app-sheet-modal'"`)
|
||||
expect(source).toContain(`:key="'app-sheet-inline'"`)
|
||||
expect(source).toContain(`:key="'app-sheet-bare'"`)
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user