From 7ffebcc9adf324a528e37f1c470dad5330463b96 Mon Sep 17 00:00:00 2001 From: viatrix Date: Tue, 11 Aug 2020 15:41:30 +0300 Subject: [PATCH] Fixed tests to add flag inat.isV2. Implements #89 --- test/inaturalist_api.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/inaturalist_api.js b/test/inaturalist_api.js index f851a553..7faca408 100644 --- a/test/inaturalist_api.js +++ b/test/inaturalist_api.js @@ -47,7 +47,7 @@ describe( "InaturalistAPI", ( ) => { describe( "lookupPreferredPlaceMiddleware", ( ) => { it( "looks up preferred_place by preferred_place_id", done => { - const req = { query: { preferred_place_id: 1, locale: "zh-LP" } }; + const req = { query: { preferred_place_id: 1, locale: "zh-LP"}, inat: {} }; InaturalistAPI.lookupPreferredPlaceMiddleware( req, null, () => { expect( req.inat.preferredPlace.id ).to.eq( 1 ); done( ); @@ -55,7 +55,7 @@ describe( "InaturalistAPI", ( ) => { } ); it( "looks up preferred_place by locale", done => { - const req = { query: { locale: "zh-LP" } }; + const req = { query: { locale: "zh-LP" }, inat: {} }; InaturalistAPI.lookupPreferredPlaceMiddleware( req, null, () => { expect( req.inat.preferredPlace.id ).to.eq( 511 ); done( ); @@ -63,9 +63,9 @@ describe( "InaturalistAPI", ( ) => { } ); it( "does not set preferred_place if locale is malformed", done => { - const req = { query: { locale: "zh-LP-LP" } }; + const req = { query: { locale: "zh-LP-LP" }, inat: {} }; InaturalistAPI.lookupPreferredPlaceMiddleware( req, null, () => { - expect( req.inat ).to.be.undefined; + expect( req.inat.preferredPlace ).to.be.undefined; done( ); } ); } );