@@ -246,10 +246,11 @@ describe('openSenseMap API locations tests', function () {
246246 expect ( result . locations ) . to . not . exist ;
247247 } ) ;
248248
249- it ( 'should return the deprecated location in box.loc' , function ( ) {
250- expect ( result . loc ) . to . exist ;
251- expect ( result . loc ) . to . deep . equal ( [ { type : 'Feature' , geometry : result . currentLocation } ] ) ;
252- } ) ;
249+ // DO WE NEED THIS?
250+ // it('should return the deprecated location in box.loc', function () {
251+ // expect(result.loc).to.exist;
252+ // expect(result.loc).to.deep.equal([{ type: 'Feature', geometry: result.currentLocation }]);
253+ // });
253254
254255 } ) ;
255256
@@ -264,7 +265,8 @@ describe('openSenseMap API locations tests', function () {
264265 expect ( response . body ) . to . have . length ( 2 ) ;
265266
266267 for ( const box of response . body ) {
267- expect ( box . currentLocation ) . to . exist ;
268+ expect ( box . longitude ) . to . exist ;
269+ expect ( box . latitude ) . to . exist ;
268270 expect ( box . locations ) . to . not . exist ;
269271 }
270272
@@ -278,11 +280,15 @@ describe('openSenseMap API locations tests', function () {
278280 return chakram . get ( `${ BASE_URL } ?bbox=120,60,121,61` )
279281 . then ( logResponseIfError )
280282 . then ( function ( response ) {
283+ console . log ( "🚀 ~ response:" , response . body )
281284 expect ( response ) . to . have . status ( 200 ) ;
282285
283286 expect ( response . body ) . to . be . an ( 'array' ) ;
284287 expect ( response . body ) . to . have . length ( 1 ) ;
285- expect ( response . body [ 0 ] . currentLocation . coordinates ) . to . deep . equal ( loc ) ;
288+ expect ( response . body [ 0 ] . longitude ) . to . equal ( loc . lng ) ;
289+ expect ( response . body [ 0 ] . latitude ) . to . equal ( loc . lat ) ;
290+ expect ( [ response . body [ 0 ] . longitude , response . body [ 0 ] . latitude ] ) . to . deep . equal ( [ loc . lng , loc . lat ] ) ;
291+ //expect(response.body[0].currentLocation.coordinates).to.deep.equal(loc);
286292 } ) ;
287293 } ) ;
288294
0 commit comments