Try not to load imagery when running tests

By default, the `rendererBackground` code will choose an initial imagery based on what
sources are available at the given map location. It looks like this code will fallback
to "custom" _before_ "none", and I noticed that in some cases it was trying to fetch
whatever source happened to be stored in the "custom" template in localStorage.

This commit adds an explicit window.location.hash in a few places to encourage the
background layer to be "none". Some tests do change the hash, so this isn't perfect.
This commit is contained in:
Bryan Housel
2021-08-16 22:51:39 -04:00
parent 33fab5580b
commit 003628d6b0
2 changed files with 4 additions and 0 deletions
+1
View File
@@ -2,6 +2,7 @@ describe('iD.modeAddNote', function() {
var context;
before(function() {
window.location.hash = '#background=none'; // Try not to load imagery
iD.services.osm = iD.serviceOsm;
});
+3
View File
@@ -5,6 +5,9 @@ iD.debug = true;
// Disable things that use the network
for (var k in iD.services) { delete iD.services[k]; }
// Try not to load imagery
window.location.hash = '#background=none';
// Run without data for speed (tests which need data can set it up themselves)
iD.fileFetcher.assetPath('../dist/');
var cached = iD.fileFetcher.cache();