From 7ad765d40883384e08ef1b60a9f709fb040c3045 Mon Sep 17 00:00:00 2001 From: Thomas Hervey Date: Mon, 16 Jul 2018 10:54:40 -0400 Subject: [PATCH] added simple tests for loading and retrieving notes --- modules/services/osm.js | 9 +++++++ test/index.html | 1 - test/spec/services/osm.js | 51 ++++++++++++++++++++++++++++++++++++++- 3 files changed, 59 insertions(+), 2 deletions(-) diff --git a/modules/services/osm.js b/modules/services/osm.js index 8ac947f5f..7e9faf49d 100644 --- a/modules/services/osm.js +++ b/modules/services/osm.js @@ -956,6 +956,15 @@ export default { }; } + // access caches directly for testing (e.g., loading notes rtree) + if (obj === 'get') { + return { + tile: _tileCache, + note: _noteCache, + user: _userCache + }; + } + if (obj.tile) { _tileCache = obj.tile; _tileCache.inflight = {}; diff --git a/test/index.html b/test/index.html index 2dc8938e4..602943c8d 100644 --- a/test/index.html +++ b/test/index.html @@ -116,7 +116,6 @@ - diff --git a/test/spec/services/osm.js b/test/spec/services/osm.js index 929b14f69..bc1617b4c 100644 --- a/test/spec/services/osm.js +++ b/test/spec/services/osm.js @@ -137,7 +137,7 @@ describe('iD.serviceOsm', function () { }); describe('#loadFromAPI', function () { - var path = '/aapi/0.6/map?bbox=-74.542,40.655,-74.541,40.656'; + var path = '/api/0.6/map?bbox=-74.542,40.655,-74.541,40.656'; var response = '' + '' + '