File tree 1 file changed +6
-9
lines changed
packages/runtime-core/__tests__/helpers
1 file changed +6
-9
lines changed Original file line number Diff line number Diff line change 1
- import { reactive , ref , shallowReactive } from '../../src/index'
1
+ import { isReactive , reactive , shallowReactive } from '../../src/index'
2
2
import { renderList } from '../../src/helpers/renderList'
3
3
4
4
describe ( 'renderList' , ( ) => {
@@ -59,15 +59,12 @@ describe('renderList', () => {
59
59
} )
60
60
61
61
it ( 'should render items in a reactive array correctly' , ( ) => {
62
- const reactiveArray = reactive ( [ { foo : ref ( 'foo' ) } ] )
63
- const shallowReactiveArray = shallowReactive ( [ { foo : ref ( 'foo' ) } ] )
62
+ const reactiveArray = reactive ( [ { foo : 1 } ] )
63
+ expect ( renderList ( reactiveArray , item => isReactive ( item ) ) ) . toEqual ( [ true ] )
64
64
65
- expect ( renderList ( reactiveArray , item => `${ typeof item . foo } ` ) ) . toEqual ( [
66
- 'string' ,
65
+ const shallowReactiveArray = shallowReactive ( [ { foo : 1 } ] )
66
+ expect ( renderList ( shallowReactiveArray , item => isReactive ( item ) ) ) . toEqual ( [
67
+ false ,
67
68
] )
68
-
69
- expect (
70
- renderList ( shallowReactiveArray , item => `${ typeof item . foo } ` ) ,
71
- ) . toEqual ( [ 'object' ] )
72
69
} )
73
70
} )
You can’t perform that action at this time.
0 commit comments