From 0514e6b6068251851d741d999dd69d9b3c35dacb Mon Sep 17 00:00:00 2001 From: tycho Date: Mon, 9 Sep 2024 18:29:58 +0800 Subject: [PATCH] test: update test --- .../__tests__/helpers/renderList.spec.ts | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/packages/runtime-core/__tests__/helpers/renderList.spec.ts b/packages/runtime-core/__tests__/helpers/renderList.spec.ts index 63c6fb15cdb..71b42a7b21f 100644 --- a/packages/runtime-core/__tests__/helpers/renderList.spec.ts +++ b/packages/runtime-core/__tests__/helpers/renderList.spec.ts @@ -1,4 +1,4 @@ -import { reactive, ref, shallowReactive } from '../../src/index' +import { isReactive, reactive, shallowReactive } from '../../src/index' import { renderList } from '../../src/helpers/renderList' describe('renderList', () => { @@ -59,15 +59,12 @@ describe('renderList', () => { }) it('should render items in a reactive array correctly', () => { - const reactiveArray = reactive([{ foo: ref('foo') }]) - const shallowReactiveArray = shallowReactive([{ foo: ref('foo') }]) + const reactiveArray = reactive([{ foo: 1 }]) + expect(renderList(reactiveArray, item => isReactive(item))).toEqual([true]) - expect(renderList(reactiveArray, item => `${typeof item.foo}`)).toEqual([ - 'string', + const shallowReactiveArray = shallowReactive([{ foo: 1 }]) + expect(renderList(shallowReactiveArray, item => isReactive(item))).toEqual([ + false, ]) - - expect( - renderList(shallowReactiveArray, item => `${typeof item.foo}`), - ).toEqual(['object']) }) })