Skip to content

Commit

Permalink
test: test case for #12597
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Jul 4, 2022
1 parent ff5acb1 commit bcb62d1
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/unit/features/v3/reactivity/shallowReactive.spec.ts
@@ -1,7 +1,9 @@
import {
isReactive,
isRef,
isShallow,
reactive,
ref,
shallowReactive,
shallowReadonly
} from 'v3'
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit bcb62d1

Please sign in to comment.