From 305efc55db74dfe804c4206c262a64a285a61ab2 Mon Sep 17 00:00:00 2001 From: Max Grossman Date: Wed, 12 Jun 2019 13:07:49 -0400 Subject: [PATCH] fix some intersection/svglines test refs #1425 --- test/spec/osm/intersection.js | 17 +++++++++-------- test/spec/spec_helpers.js | 3 ++- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/test/spec/osm/intersection.js b/test/spec/osm/intersection.js index ecb23a265c..0fc00c0205 100644 --- a/test/spec/osm/intersection.js +++ b/test/spec/osm/intersection.js @@ -127,7 +127,7 @@ describe('iD.osmIntersection', function() { expect(turns[1].u).to.be.true; expect(turns[2]).to.be.an.instanceOf(iD.osmTurn); - expect(turns[2].key).to.match(/^-\_\*\_w-\d+$/); // new way + expect(turns[2].key).to.match(/^-\_\*\_w-\d_\d+$/); // new way expect(turns[2].u).to.be.not.ok; }); @@ -158,7 +158,7 @@ describe('iD.osmIntersection', function() { expect(turns[1].u).to.be.not.ok; expect(turns[2]).to.be.an.instanceOf(iD.osmTurn); - expect(turns[2].key).to.match(/^=\_\*\_w-\d+$/); // new way + expect(turns[2].key).to.match(/^=\_\*\_w-\d+_\d+$/); // new way expect(turns[2].u).to.be.not.ok; }); @@ -403,7 +403,7 @@ describe('iD.osmIntersection', function() { expect(turns[1].u).to.be.true; expect(turns[2]).to.be.an.instanceOf(iD.osmTurn); - expect(turns[2].key).to.match(/^=\_\*\_w-\d+$/); // new way + expect(turns[2].key).to.match(/^=\_\*\_w-\d+_\d+$/); // new way expect(turns[2].u).to.be.not.ok; }); @@ -435,7 +435,7 @@ describe('iD.osmIntersection', function() { expect(turns[1].u).to.be.not.ok; expect(turns[2]).to.be.an.instanceOf(iD.osmTurn); - expect(turns[2].key).to.match(/^-\_\*\_w-\d+$/); // new way + expect(turns[2].key).to.match(/^-\_\*\_w-\d+_\d+$/); // new way expect(turns[2].u).to.be.not.ok; }); @@ -479,7 +479,7 @@ describe('iD.osmIntersection', function() { iD.osmNode({id: 'c'}), iD.osmNode({id: '*'}), iD.osmNode({id: 'u'}), - iD.osmWay({id: '-', nodes: ['*', 'a', 'b', 'c', '*'], tags: {highway: 'residential', oneway: '-1'}}), + iD.osmWay({id: '-_50', nodes: ['*', 'a', 'b', 'c', '*'], tags: {highway: 'residential', oneway: '-1'}}), iD.osmWay({id: '=', nodes: ['*', 'u'], tags: {highway: 'residential'}}) ]); @@ -487,7 +487,7 @@ describe('iD.osmIntersection', function() { expect(turns.length).to.eql(2); expect(turns[0]).to.be.an.instanceOf(iD.osmTurn); - expect(turns[0].key).to.eql('=_*_-'); + expect(turns[0].key).to.eql('=_*_-_50'); expect(turns[0].u).to.be.not.ok; expect(turns[1]).to.be.an.instanceOf(iD.osmTurn); @@ -512,7 +512,8 @@ describe('iD.osmIntersection', function() { ]); var intersection = iD.osmIntersection(graph, '*'); - var newWay = intersection.ways.find(function(w) { return /^w-\d+$/.test(w.id); }); + intersection.actions.forEach(function (a) { a(graph); }); + var newWay = intersection.ways.find(function(w) { return /^w-\d+_\d+$/.test(w.id); }); var turns = iD.osmIntersection(graph, '*').turns(newWay.id); expect(turns.length).to.eql(2); @@ -542,7 +543,7 @@ describe('iD.osmIntersection', function() { ]); var intersection = iD.osmIntersection(graph, '*'); - var newWay = intersection.ways.find(function(w) { return /^w-\d+$/.test(w.id); }); + var newWay = intersection.ways.find(function(w) { return /^w-\d+_\d+$/.test(w.id); }); var turns = iD.osmIntersection(graph, '*').turns(newWay.id); expect(turns.length).to.eql(2); diff --git a/test/spec/spec_helpers.js b/test/spec/spec_helpers.js index 71c989b472..48148772ff 100644 --- a/test/spec/spec_helpers.js +++ b/test/spec/spec_helpers.js @@ -38,7 +38,8 @@ window.Hoot = { }, refType: 'primary' } - } + }, + getTopLayer: function(){} } };