Better isolation of services, to avoid hitting network during test runs

1. All services are disabled in testing now to prevent network accesses
2. Only services are enabled when needed to test something
3. Many changes throughout code to allow iD to run with services disabled
   (e.g. check for osm service instead of assuming context.connection() will work)
4. Actually export the services so we can disable and enable them
This commit is contained in:
Bryan Housel
2017-08-09 22:04:09 -04:00
parent b7958415b3
commit 99a3741b0c
22 changed files with 219 additions and 117 deletions
+6 -3
View File
@@ -26,6 +26,9 @@ export function uiCommit(context) {
function commit(selection) {
var osm = context.connection();
if (!osm) return;
if (!changeset) {
var detected = utilDetect(),
tags = {
@@ -87,7 +90,7 @@ export function uiCommit(context) {
commentField.node().select();
context.connection().userChangesets(function (err, changesets) {
osm.userChangesets(function (err, changesets) {
if (err) return;
var comments = changesets.map(function(changeset) {
@@ -174,7 +177,7 @@ export function uiCommit(context) {
.html(t('commit.upload_explanation'));
context.connection().userDetails(function(err, user) {
osm.userDetails(function(err, user) {
if (err) return;
var userLink = d3.select(document.createElement('div'));
@@ -190,7 +193,7 @@ export function uiCommit(context) {
.append('a')
.attr('class','user-info')
.text(user.display_name)
.attr('href', context.connection().userURL(user.display_name))
.attr('href', osm.userURL(user.display_name))
.attr('tabindex', -1)
.attr('target', '_blank');