mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-15 13:38:26 +02:00
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:
@@ -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;
|
||||
});
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user