From 003628d6b089587070e31333ca9da977f4322cb1 Mon Sep 17 00:00:00 2001 From: Bryan Housel Date: Mon, 16 Aug 2021 22:51:39 -0400 Subject: [PATCH] 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. --- test/spec/modes/add_note.js | 1 + test/spec/spec_helpers.js | 3 +++ 2 files changed, 4 insertions(+) diff --git a/test/spec/modes/add_note.js b/test/spec/modes/add_note.js index 6650e8576..def8159ae 100644 --- a/test/spec/modes/add_note.js +++ b/test/spec/modes/add_note.js @@ -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; }); diff --git a/test/spec/spec_helpers.js b/test/spec/spec_helpers.js index 137ca83b4..5fb66a4b7 100644 --- a/test/spec/spec_helpers.js +++ b/test/spec/spec_helpers.js @@ -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();