Skip to content

Commit

Permalink
fix some intersection/svglines test
Browse files Browse the repository at this point in the history
refs #1425
  • Loading branch information
maxgrossman committed Jun 12, 2019
1 parent 76fabe0 commit 305efc5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
17 changes: 9 additions & 8 deletions test/spec/osm/intersection.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
});

Expand Down Expand Up @@ -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;
});

Expand Down Expand Up @@ -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;
});

Expand Down Expand Up @@ -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;
});

Expand Down Expand Up @@ -479,15 +479,15 @@ 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'}})
]);

var turns = iD.osmIntersection(graph, '*').turns('=');
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);
Expand All @@ -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);

Expand Down Expand Up @@ -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);

Expand Down
3 changes: 2 additions & 1 deletion test/spec/spec_helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ window.Hoot = {
},
refType: 'primary'
}
}
},
getTopLayer: function(){}
}
};

Expand Down

0 comments on commit 305efc5

Please sign in to comment.