diff --git a/packages/runtime-core/__tests__/hydration.spec.ts b/packages/runtime-core/__tests__/hydration.spec.ts index 042f1a735c6..679301c1d38 100644 --- a/packages/runtime-core/__tests__/hydration.spec.ts +++ b/packages/runtime-core/__tests__/hydration.spec.ts @@ -3325,6 +3325,76 @@ describe('SSR hydration', () => { expect(`mismatch`).not.toHaveBeenWarned() }) + // #16427 + test('transition appear with cached static child in prod', () => { + __DEV__ = false + try { + const { vnode, container } = mountWithHydration( + ``, + () => + h( + Transition, + { appear: true }, + { + default: () => + createElementVNode('div', null, 'foo', PatchFlags.CACHED), + }, + ), + ) + expect(container.firstChild).toMatchInlineSnapshot(` +
+ foo +
+ `) + expect(vnode.el).toBe(container.firstChild) + } finally { + __DEV__ = true + } + }) + + // #16427 + test.each([ + { + name: 'appear', + template: `
foo
`, + html: `
foo
`, + }, + { + name: ':appear="false"', + template: `
foo
`, + html: `
foo
`, + }, + // a native