Skip to content

Commit

Permalink
test: update test
Browse files Browse the repository at this point in the history
  • Loading branch information
jh-leong committed Sep 9, 2024
1 parent 5015687 commit 0514e6b
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions packages/runtime-core/__tests__/helpers/renderList.spec.ts
Original file line number Diff line number Diff line change
@@ -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', () => {
Expand Down Expand Up @@ -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'])
})
})

0 comments on commit 0514e6b

Please sign in to comment.