@@ -146,12 +146,17 @@ describe('Collection methods', function () {
146146
147147    it ( 'should throw an error if no scrollId is set' ,  ( )  =>  { 
148148      var  collection  =  kuzzle . collection ( expectedQuery . collection ) ; 
149-       should ( ( )  =>  {  collection . scroll ( ) ;  } ) . throw ( 'Collection.scroll: scrollId required' ) ; 
149+       should ( ( )  =>  {  collection . scroll ( ) ;  } ) . throw ( 'Collection.scroll: scrollId is required' ) ; 
150+     } ) ; 
151+ 
152+     it ( 'should throw an error if no scroll is provided' ,  ( )  =>  { 
153+       var  collection  =  kuzzle . collection ( expectedQuery . collection ) ; 
154+       should ( ( )  =>  {  collection . scroll ( 'scrollId' ) ;  } ) . throw ( 'Collection.scroll: scroll is required' ) ; 
150155    } ) ; 
151156
152157    it ( 'should throw an error if no callback is given' ,  ( )  =>  { 
153158      var  collection  =  kuzzle . collection ( expectedQuery . collection ) ; 
154-       should ( ( )  =>  {  collection . scroll ( 'scrollId' ) ;  } ) . throw ( 'Collection.scroll: a callback argument is required for read queries' ) ; 
159+       should ( ( )  =>  {  collection . scroll ( 'scrollId' ,   { scroll :  '1m' } ) ;  } ) . throw ( 'Collection.scroll: a callback argument is required for read queries' ) ; 
155160    } ) ; 
156161
157162    it ( 'should parse the given parameters' ,  done  =>  { 
@@ -189,33 +194,6 @@ describe('Collection methods', function () {
189194
190195      collection . scroll ( scrollId ,  options ,  filters ,  cb ) ; 
191196    } ) ; 
192- 
193-     it ( 'should parse the given parameters even if no options is given' ,  done  =>  { 
194-       var 
195-         queryScrollStub , 
196-         collection  =  kuzzle . collection ( expectedQuery . collection ) , 
197-         scrollId  =  'scrollId' , 
198-         cb  =  ( )  =>  { 
199-           done ( ) ; 
200-         } ; 
201- 
202-       queryScrollStub  =  function  ( args ,  query ,  opts ,  callback )  { 
203-         should ( args . controller ) . be . exactly ( 'document' ) ; 
204-         should ( args . action ) . be . exactly ( 'scroll' ) ; 
205-         should ( opts . scrollId ) . be . exactly ( scrollId ) ; 
206- 
207-         callback ( null ,  { 
208-           result : { 
209-             total : 0 , 
210-             hits : [ ] 
211-           } 
212-         } ) ; 
213-       } ; 
214- 
215-       kuzzle . query  =  queryScrollStub ; 
216- 
217-       collection . scroll ( scrollId ,  cb ) ; 
218-     } ) ; 
219197  } ) ; 
220198
221199  describe ( '#count' ,  function  ( )  { 
0 commit comments