@@ -188,7 +188,10 @@ describe('useStacSearch — API supports POST', () => {
188188 await waitFor ( ( ) => expect ( result . current . results ) . toEqual ( { data : '12345' } ) ) ;
189189 // Validate POST payload
190190 const postPayload = parseRequestPayload ( fetch . mock . calls [ 1 ] [ 1 ] ) ;
191- expect ( postPayload ) . toEqual ( { datetime : '2022-01-17/2022-05-17' , limit : 25 } ) ;
191+ expect ( postPayload ) . toEqual ( {
192+ datetime : '2022-01-17T00:00:00Z/2022-05-17T23:59:59Z' ,
193+ limit : 25 ,
194+ } ) ;
192195 } ) ;
193196
194197 it ( 'includes open date range in search (no to-date)' , async ( ) => {
@@ -215,7 +218,7 @@ describe('useStacSearch — API supports POST', () => {
215218 await waitFor ( ( ) => expect ( result . current . results ) . toEqual ( { data : '12345' } ) ) ;
216219 // Validate POST payload
217220 const postPayload = parseRequestPayload ( fetch . mock . calls [ 1 ] [ 1 ] ) ;
218- expect ( postPayload ) . toEqual ( { datetime : '2022-01-17 /..' , limit : 25 } ) ;
221+ expect ( postPayload ) . toEqual ( { datetime : '2022-01-17T00:00:00Z /..' , limit : 25 } ) ;
219222 } ) ;
220223
221224 it ( 'includes open date range in search (no from-date)' , async ( ) => {
@@ -242,7 +245,7 @@ describe('useStacSearch — API supports POST', () => {
242245 await waitFor ( ( ) => expect ( result . current . results ) . toEqual ( { data : '12345' } ) ) ;
243246 // Validate POST payload
244247 const postPayload = parseRequestPayload ( fetch . mock . calls [ 1 ] [ 1 ] ) ;
245- expect ( postPayload ) . toEqual ( { datetime : '../2022-05-17 ' , limit : 25 } ) ;
248+ expect ( postPayload ) . toEqual ( { datetime : '../2022-05-17T23:59:59Z ' , limit : 25 } ) ;
246249 } ) ;
247250
248251 it ( 'handles error with JSON response' , async ( ) => {
@@ -799,7 +802,7 @@ describe('useStacSearch — API supports GET', () => {
799802 await waitFor ( ( ) => expect ( fetch ) . toHaveBeenCalledTimes ( 2 ) ) ;
800803 // Assert fetch URL and results
801804 expect ( fetch . mock . calls [ 1 ] [ 0 ] ) . toEqual (
802- 'https://fake-stac-api.net/search?limit=25&datetime=2022-01-17% 2F2022-05-17 '
805+ 'https://fake-stac-api.net/search?limit=25&datetime=2022-01-17T00%3A00%3A00Z% 2F2022-05-17T23%3A59%3A59Z '
803806 ) ;
804807 expect ( result . current . results ) . toEqual ( { data : '12345' } ) ;
805808 } ) ;
@@ -825,7 +828,7 @@ describe('useStacSearch — API supports GET', () => {
825828 await waitFor ( ( ) => expect ( fetch ) . toHaveBeenCalledTimes ( 2 ) ) ;
826829 // Assert fetch URL and results
827830 expect ( fetch . mock . calls [ 1 ] [ 0 ] ) . toEqual (
828- 'https://fake-stac-api.net/search?limit=25&datetime=2022-01-17 %2F..'
831+ 'https://fake-stac-api.net/search?limit=25&datetime=2022-01-17T00%3A00%3A00Z %2F..'
829832 ) ;
830833 expect ( result . current . results ) . toEqual ( { data : '12345' } ) ;
831834 } ) ;
@@ -851,7 +854,7 @@ describe('useStacSearch — API supports GET', () => {
851854 await waitFor ( ( ) => expect ( fetch ) . toHaveBeenCalledTimes ( 2 ) ) ;
852855 // Assert fetch URL and results
853856 expect ( fetch . mock . calls [ 1 ] [ 0 ] ) . toEqual (
854- 'https://fake-stac-api.net/search?limit=25&datetime=..%2F2022-05-17 '
857+ 'https://fake-stac-api.net/search?limit=25&datetime=..%2F2022-05-17T23%3A59%3A59Z '
855858 ) ;
856859 expect ( result . current . results ) . toEqual ( { data : '12345' } ) ;
857860 } ) ;
0 commit comments