@@ -138,15 +138,14 @@ describe('firestore().collection().where()', function () {
138138 }
139139 } ) ;
140140
141- it ( 'throws if in query array length is greater than 10 ' , function ( ) {
141+ it ( 'throws if in query array length is greater than 30 ' , function ( ) {
142142 try {
143- firebase
144- . firestore ( )
145- . collection ( COLLECTION )
146- . where ( 'foo.bar' , 'in' , [ 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 ] ) ;
143+ const queryArray = Array . from ( { length : 31 } , ( _ , i ) => i + 1 ) ;
144+
145+ firebase . firestore ( ) . collection ( COLLECTION ) . where ( 'foo.bar' , 'in' , queryArray ) ;
147146 return Promise . reject ( new Error ( 'Did not throw an Error.' ) ) ;
148147 } catch ( error ) {
149- error . message . should . containEql ( 'maximum of 10 elements in the value' ) ;
148+ error . message . should . containEql ( 'maximum of 30 elements in the value' ) ;
150149 return Promise . resolve ( ) ;
151150 }
152151 } ) ;
@@ -483,13 +482,14 @@ describe('firestore().collection().where()', function () {
483482
484483 it ( "should throw error when 'not-in' filter has a list of more than 10 items" , async function ( ) {
485484 const ref = firebase . firestore ( ) . collection ( COLLECTION ) ;
485+ const queryArray = Array . from ( { length : 31 } , ( _ , i ) => i + 1 ) ;
486486
487487 try {
488- ref . where ( 'test' , 'not-in' , [ 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 ] ) ;
488+ ref . where ( 'test' , 'not-in' , queryArray ) ;
489489 return Promise . reject ( new Error ( 'Did not throw an Error.' ) ) ;
490490 } catch ( error ) {
491491 error . message . should . containEql (
492- 'filters support a maximum of 10 elements in the value array.' ,
492+ 'filters support a maximum of 30 elements in the value array.' ,
493493 ) ;
494494 return Promise . resolve ( ) ;
495495 }
@@ -708,16 +708,15 @@ describe('firestore().collection().where()', function () {
708708 }
709709 } ) ;
710710
711- it ( 'throws if in query array length is greater than 10 ' , function ( ) {
711+ it ( 'throws if in query array length is greater than 30 ' , function ( ) {
712712 const { getFirestore, collection, query, where } = firestoreModular ;
713+ const queryArray = Array . from ( { length : 31 } , ( _ , i ) => i + 1 ) ;
714+
713715 try {
714- query (
715- collection ( getFirestore ( ) , COLLECTION ) ,
716- where ( 'foo.bar' , 'in' , [ 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 ] ) ,
717- ) ;
716+ query ( collection ( getFirestore ( ) , COLLECTION ) , where ( 'foo.bar' , 'in' , queryArray ) ) ;
718717 return Promise . reject ( new Error ( 'Did not throw an Error.' ) ) ;
719718 } catch ( error ) {
720- error . message . should . containEql ( 'maximum of 10 elements in the value' ) ;
719+ error . message . should . containEql ( 'maximum of 30 elements in the value' ) ;
721720 return Promise . resolve ( ) ;
722721 }
723722 } ) ;
@@ -1086,13 +1085,14 @@ describe('firestore().collection().where()', function () {
10861085 it ( "should throw error when 'not-in' filter has a list of more than 10 items" , async function ( ) {
10871086 const { getFirestore, collection, query, where } = firestoreModular ;
10881087 const ref = collection ( getFirestore ( ) , COLLECTION ) ;
1088+ const queryArray = Array . from ( { length : 31 } , ( _ , i ) => i + 1 ) ;
10891089
10901090 try {
1091- query ( ref , where ( 'test' , 'not-in' , [ 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 ] ) ) ;
1091+ query ( ref , where ( 'test' , 'not-in' , queryArray ) ) ;
10921092 return Promise . reject ( new Error ( 'Did not throw an Error.' ) ) ;
10931093 } catch ( error ) {
10941094 error . message . should . containEql (
1095- 'filters support a maximum of 10 elements in the value array.' ,
1095+ 'filters support a maximum of 30 elements in the value array.' ,
10961096 ) ;
10971097 return Promise . resolve ( ) ;
10981098 }
0 commit comments