@@ -14,7 +14,7 @@ const __filename = fileURLToPath(import.meta.url)
14
14
const __dirname = path . dirname ( __filename ) // eslint-disable-line no-unused-vars
15
15
const intersectsGeometry = fs . readFileSync ( path . resolve ( __dirname , '../fixtures/stac/intersectsGeometry.json' ) , 'utf8' )
16
16
17
- const fixture = ( filepath ) => fs . readFileSync ( path . resolve ( __dirname , filepath ) , 'utf8' )
17
+ // const fixture = (filepath) => fs.readFileSync(path.resolve(__dirname, filepath), 'utf8')
18
18
19
19
const ingestEntities = async ( fixtures ) => {
20
20
await ingestItems (
@@ -420,63 +420,68 @@ test('/search preserve intersects geometry in next link', async (t) => {
420
420
t . deepEqual ( nextLink . body . intersects , intersectsGeometry )
421
421
} )
422
422
423
- test ( 'POST /search using bad geometry, expecting useful error messages' , async ( t ) => {
424
- let response = null
425
-
426
- response = await t . context . api . client . post ( 'search' , {
427
- json : {
428
- intersects : fixture ( '../fixtures/geometry/badGeoUnclosed.json' )
429
- }
430
- } )
431
- t . is ( response . statusCode , 400 )
432
- t . deepEqual ( response . body , [ { message : 'the first and last positions in a LinearRing of coordinates must be the same' } ] )
433
-
434
- response = await t . context . api . client . post ( 'search' , {
435
- json : {
436
- intersects : fixture ( '../fixtures/geometry/badGeoRightHandRule.json' )
437
- }
438
- } )
439
- t . is ( response . statusCode , 400 )
440
- t . deepEqual ( response . body , [ { message : 'Polygons and MultiPolygons should follow the right-hand rule' } ] )
441
-
442
- response = await t . context . api . client . post ( 'search' , {
443
- json : {
444
- intersects : fixture ( '../fixtures/geometry/badGeoFourPoints.json' )
445
- }
446
- } )
447
- t . is ( response . statusCode , 400 )
448
- t . deepEqual ( response . body , [
449
- {
450
- reason : 'failed to create query: at least 4 polygon points required'
451
- } ,
452
- {
453
- reason : 'failed to create query: at least 4 polygon points required'
454
- }
455
- ] )
456
-
457
- response = await t . context . api . client . post ( 'search' , {
458
- json : {
459
- intersects : fixture ( '../fixtures/geometry/badGeoDuplicateConsecutive.json' )
460
- }
461
- } )
462
- t . is ( response . statusCode , 400 )
463
- t . deepEqual ( response . body , [
464
- {
465
- reason : 'failed to create query: Provided shape has duplicate consecutive coordinates at: (POINT (100.0 1.0))'
466
- } ,
467
- {
468
- reason : 'failed to create query: Provided shape has duplicate consecutive coordinates at: (POINT (100.0 1.0))'
469
- }
470
- ] )
471
-
472
- response = await t . context . api . client . post ( 'search' , {
473
- json : {
474
- intersects : fixture ( '../fixtures/geometry/badGeoRightHandRule2.json' )
475
- }
476
- } )
477
- t . is ( response . statusCode , 400 )
478
- t . deepEqual ( response . body , [ { message : 'Polygons and MultiPolygons should follow the right-hand rule' } ] )
479
- } )
423
+ // test('POST /search using bad geometry, expecting useful error messages', async (t) => {
424
+ // let response = null
425
+
426
+ // response = await t.context.api.client.post('search', {
427
+ // json: {
428
+ // intersects: fixture('../fixtures/geometry/badGeoUnclosed.json')
429
+ // }
430
+ // })
431
+ // t.is(response.statusCode, 400)
432
+ // t.deepEqual(response.body,
433
+ // [{ message: 'the first and last positions in a LinearRing of coordinates must be the same' }])
434
+
435
+ // response = await t.context.api.client.post('search', {
436
+ // json: {
437
+ // intersects: fixture('../fixtures/geometry/badGeoRightHandRule.json')
438
+ // }
439
+ // })
440
+ // t.is(response.statusCode, 400)
441
+ // t.deepEqual(response.body,
442
+ // [{ message: 'Polygons and MultiPolygons should follow the right-hand rule' }])
443
+
444
+ // response = await t.context.api.client.post('search', {
445
+ // json: {
446
+ // intersects: fixture('../fixtures/geometry/badGeoFourPoints.json')
447
+ // }
448
+ // })
449
+ // t.is(response.statusCode, 400)
450
+ // t.deepEqual(response.body, [
451
+ // {
452
+ // reason: 'failed to create query: at least 4 polygon points required'
453
+ // },
454
+ // {
455
+ // reason: 'failed to create query: at least 4 polygon points required'
456
+ // }
457
+ // ])
458
+
459
+ // response = await t.context.api.client.post('search', {
460
+ // json: {
461
+ // intersects: fixture('../fixtures/geometry/badGeoDuplicateConsecutive.json')
462
+ // }
463
+ // })
464
+ // t.is(response.statusCode, 400)
465
+ // t.deepEqual(response.body, [
466
+ // {
467
+ // reason: 'failed to create query:
468
+ // Provided shape has duplicate consecutive coordinates at: (POINT (100.0 1.0))'
469
+ // },
470
+ // {
471
+ // reason: 'failed to create query:
472
+ // Provided shape has duplicate consecutive coordinates at: (POINT (100.0 1.0))'
473
+ // }
474
+ // ])
475
+
476
+ // response = await t.context.api.client.post('search', {
477
+ // json: {
478
+ // intersects: fixture('../fixtures/geometry/badGeoRightHandRule2.json')
479
+ // }
480
+ // })
481
+ // t.is(response.statusCode, 400)
482
+ // t.deepEqual(response.body,
483
+ // [{ message: 'Polygons and MultiPolygons should follow the right-hand rule' }])
484
+ // })
480
485
481
486
test ( '/search preserve bbox in prev and next links' , async ( t ) => {
482
487
const bbox = [ - 180 , - 90 , 180 , 90 ]
0 commit comments