chore: update test

This commit is contained in:
daiwei 2024-11-18 11:26:37 +08:00
parent e26787a92f
commit 129b9ee19e
1 changed files with 6 additions and 5 deletions

View File

@ -113,14 +113,15 @@ describe('reactivity/reactive', () => {
})
// #8647
test('observing nest reactive in set', () => {
test('observing Set with reactive initial value', () => {
const observed = reactive({})
const observedSet = reactive(new Set([observed]))
expect(observedSet.has(observed)).toBe(true)
expect(observedSet.size).toBe(1)
if (observedSet.has(observed)) {
// expect nothing happens
observedSet.add(observed)
}
// expect nothing happens
observedSet.add(observed)
expect(observedSet.size).toBe(1)
})