@@ -5,7 +5,6 @@ import sinonChai from 'sinon-chai';
55import * as db from '../../database/db' ;
66import { SearchService } from '../../services/search-service' ;
77import { SearchResponseWithCounts } from '../../services/search-service.interface' ;
8- import { ensureCompletePaginationOptions } from '../../utils/pagination' ;
98import { getMockDBConnection , getRequestHandlerMocks } from '../../__mocks__/db' ;
109import * as search from './index' ;
1110
@@ -31,7 +30,7 @@ describe('search', () => {
3130 taxonomy : { data : [ ] , total : 0 }
3231 } ;
3332
34- const defaultPaginationNumbers = { page : 1 , limit : 2 } ;
33+ const defaultPaginationNumbers = { page : 1 , limit : 2 , sort : undefined , order : undefined } ;
3534
3635 afterEach ( ( ) => {
3736 sinon . restore ( ) ;
@@ -56,7 +55,7 @@ describe('search', () => {
5655
5756 expect ( mockSearch ) . to . have . been . calledOnceWith (
5857 { keyword : 'moose habitat' , feature_type_name : undefined } ,
59- ensureCompletePaginationOptions ( defaultPaginationNumbers )
58+ defaultPaginationNumbers
6059 ) ;
6160
6261 expect ( mockRes . statusValue ) . to . equal ( 200 ) ;
@@ -82,15 +81,15 @@ describe('search', () => {
8281
8382 expect ( mockSearch ) . to . have . been . calledOnceWith (
8483 { keyword : 'moose' , feature_type_name : 'dataset' } ,
85- ensureCompletePaginationOptions ( defaultPaginationNumbers )
84+ defaultPaginationNumbers
8685 ) ;
8786
8887 expect ( mockRes . statusValue ) . to . equal ( 200 ) ;
8988 expect ( mockRes . jsonValue ) . to . eql ( mockResultsWithData ) ;
9089 } ) ;
9190
9291 it ( 'should return search results with custom pagination' , async ( ) => {
93- const customNumbers = { page : 2 , limit : 5 } ;
92+ const customNumbers = { page : 2 , limit : 5 , sort : undefined , order : undefined } ;
9493 const dbConnectionObj = getMockDBConnection ( {
9594 open : sinon . stub ( ) . resolves ( ) ,
9695 commit : sinon . stub ( ) . resolves ( ) ,
@@ -109,7 +108,7 @@ describe('search', () => {
109108
110109 expect ( mockSearch ) . to . have . been . calledOnceWith (
111110 { keyword : 'wildlife' , feature_type_name : undefined } ,
112- ensureCompletePaginationOptions ( customNumbers )
111+ customNumbers
113112 ) ;
114113
115114 expect ( mockRes . statusValue ) . to . equal ( 200 ) ;
@@ -135,7 +134,7 @@ describe('search', () => {
135134
136135 expect ( mockSearch ) . to . have . been . calledOnceWith (
137136 { keyword : '' , feature_type_name : undefined } ,
138- ensureCompletePaginationOptions ( defaultPaginationNumbers )
137+ defaultPaginationNumbers
139138 ) ;
140139
141140 expect ( mockRes . statusValue ) . to . equal ( 200 ) ;
0 commit comments