@@ -5,7 +5,7 @@ import getDestinationData from '../../../lib/tasks/get-destination-data'
5
5
6
6
const sourceData = {
7
7
contentTypes : times ( 150 , ( n ) => ( { sys : { id : `ct-${ n } ` } } ) ) ,
8
- locales : times ( 5 , ( n ) => ( { sys : { id : `ct-${ n } ` } } ) ) ,
8
+ locales : times ( 105 , ( n ) => ( { sys : { id : `ct-${ n } ` } } ) ) ,
9
9
entries : times ( 2000 , ( n ) => ( { sys : { id : `e-${ n } ` } } ) ) ,
10
10
assets : times ( 1500 , ( n ) => ( { sys : { id : `a-${ n } ` } } ) ) ,
11
11
tags : times ( 250 , ( n ) => ( { sys : { id : `t-${ n } ` } , name : `t-${ n } ` } ) )
@@ -38,7 +38,7 @@ const mockEnvironment = {
38
38
getContentTypes : jest . fn ( batchQueryResolver ) ,
39
39
getEntries : jest . fn ( batchQueryResolver ) ,
40
40
getAssets : jest . fn ( batchQueryResolver ) ,
41
- getLocales : jest . fn ( batchQueryResolver ) ,
41
+ getLocales : jest . fn ( batchPageResolver ( sourceData . locales ) ) ,
42
42
getTags : jest . fn ( batchPageResolver ( sourceData . tags ) ) // resolve 250 tags
43
43
}
44
44
@@ -90,15 +90,14 @@ test('Gets destination content', () => {
90
90
. then ( ( response ) => {
91
91
expect ( mockEnvironment . getContentTypes . mock . calls ) . toHaveLength ( 2 )
92
92
testQueryLength ( 'getContentTypes' )
93
- expect ( mockEnvironment . getLocales . mock . calls ) . toHaveLength ( 1 )
94
- testQueryLength ( 'getLocales' )
93
+ expect ( mockEnvironment . getLocales . mock . calls ) . toHaveLength ( 2 )
95
94
expect ( mockEnvironment . getEntries . mock . calls ) . toHaveLength ( 20 )
96
95
testQueryLength ( 'getEntries' )
97
96
expect ( mockEnvironment . getAssets . mock . calls ) . toHaveLength ( 15 )
98
97
testQueryLength ( 'getAssets' )
99
98
expect ( mockEnvironment . getTags . mock . calls ) . toHaveLength ( 3 )
100
99
expect ( response . contentTypes ) . toHaveLength ( 150 )
101
- expect ( response . locales ) . toHaveLength ( 5 )
100
+ expect ( response . locales ) . toHaveLength ( 105 )
102
101
expect ( response . entries ) . toHaveLength ( 2000 )
103
102
expect ( response . assets ) . toHaveLength ( 1500 )
104
103
expect ( response . tags ) . toHaveLength ( 250 )
@@ -171,13 +170,12 @@ test('Gets destination content with contentModelOnly', () => {
171
170
. then ( ( response ) => {
172
171
expect ( mockEnvironment . getContentTypes . mock . calls ) . toHaveLength ( 2 )
173
172
testQueryLength ( 'getContentTypes' )
174
- expect ( mockEnvironment . getLocales . mock . calls ) . toHaveLength ( 1 )
175
- testQueryLength ( 'getLocales' )
173
+ expect ( mockEnvironment . getLocales . mock . calls ) . toHaveLength ( 2 )
176
174
expect ( mockEnvironment . getEntries . mock . calls ) . toHaveLength ( 0 )
177
175
expect ( mockEnvironment . getAssets . mock . calls ) . toHaveLength ( 0 )
178
176
expect ( mockEnvironment . getTags . mock . calls ) . toHaveLength ( 3 )
179
177
expect ( response . contentTypes ) . toHaveLength ( 150 )
180
- expect ( response . locales ) . toHaveLength ( 5 )
178
+ expect ( response . locales ) . toHaveLength ( 105 )
181
179
expect ( response . entries ) . toHaveLength ( 0 )
182
180
expect ( response . assets ) . toHaveLength ( 0 )
183
181
expect ( response . tags ) . toHaveLength ( 250 )
0 commit comments