mirror of
https://github.com/vuejs/vue.git
synced 2024-11-21 20:28:54 +00:00
test: test case for #12597
This commit is contained in:
parent
ff5acb12cf
commit
bcb62d1a00
@ -1,7 +1,9 @@
|
||||
import {
|
||||
isReactive,
|
||||
isRef,
|
||||
isShallow,
|
||||
reactive,
|
||||
ref,
|
||||
shallowReactive,
|
||||
shallowReadonly
|
||||
} from 'v3'
|
||||
@ -34,6 +36,15 @@ describe('shallowReactive', () => {
|
||||
expect(isReactive(r.foo.bar)).toBe(false)
|
||||
})
|
||||
|
||||
// #12597
|
||||
test('should not unwrap refs', () => {
|
||||
const foo = shallowReactive({
|
||||
bar: ref(123)
|
||||
})
|
||||
expect(isRef(foo.bar)).toBe(true)
|
||||
expect(foo.bar.value).toBe(123)
|
||||
})
|
||||
|
||||
// @discrepancy no shallow/non-shallow versions from the same source -
|
||||
// cannot support this without real proxies
|
||||
// #2843
|
||||
|
Loading…
Reference in New Issue
Block a user