Skip to content

Commit bcb62d1

Browse files
committed
test: test case for #12597
1 parent ff5acb1 commit bcb62d1

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

test/unit/features/v3/reactivity/shallowReactive.spec.ts

+11
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import {
22
isReactive,
3+
isRef,
34
isShallow,
45
reactive,
6+
ref,
57
shallowReactive,
68
shallowReadonly
79
} from 'v3'
@@ -34,6 +36,15 @@ describe('shallowReactive', () => {
3436
expect(isReactive(r.foo.bar)).toBe(false)
3537
})
3638

39+
// #12597
40+
test('should not unwrap refs', () => {
41+
const foo = shallowReactive({
42+
bar: ref(123)
43+
})
44+
expect(isRef(foo.bar)).toBe(true)
45+
expect(foo.bar.value).toBe(123)
46+
})
47+
3748
// @discrepancy no shallow/non-shallow versions from the same source -
3849
// cannot support this without real proxies
3950
// #2843

0 commit comments

Comments
 (0)