Skip to content

Commit 32a6271

Browse files
committed
test(props): the props are not reactive in funcational component
1 parent f3e4f03 commit 32a6271

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

packages/runtime-core/__tests__/componentProps.spec.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ import {
1313
inject,
1414
watch,
1515
toRefs,
16-
SetupContext
16+
SetupContext,
17+
isProxy
1718
} from '@vue/runtime-test'
1819
import { render as domRender, nextTick } from 'vue'
1920

@@ -105,10 +106,12 @@ describe('component props', () => {
105106
render(h(Comp, { foo: 2, bar: 3, baz: 4 }), root)
106107
expect(props).toEqual({ foo: 2 })
107108
expect(attrs).toEqual({ bar: 3, baz: 4 })
109+
expect(isProxy(props)).toBe(false)
108110

109111
render(h(Comp, { qux: 5 }), root)
110112
expect(props).toEqual({})
111113
expect(attrs).toEqual({ qux: 5 })
114+
expect(isProxy(props)).toBe(false)
112115
})
113116

114117
test('functional without declaration', () => {
@@ -124,11 +127,13 @@ describe('component props', () => {
124127
expect(props).toEqual({ foo: 1 })
125128
expect(attrs).toEqual({ foo: 1 })
126129
expect(props).toBe(attrs)
130+
expect(isProxy(props)).toBe(false)
127131

128132
render(h(Comp, { bar: 2 }), root)
129133
expect(props).toEqual({ bar: 2 })
130134
expect(attrs).toEqual({ bar: 2 })
131135
expect(props).toBe(attrs)
136+
expect(isProxy(props)).toBe(false)
132137
})
133138

134139
test('boolean casting', () => {

0 commit comments

Comments
 (0)