mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-31 04:09:33 +02:00
@@ -1,24 +1,21 @@
|
||||
describe('iD.actionUnrestrictTurn', function() {
|
||||
it('removes a restriction from a restricted turn', function() {
|
||||
// u====*--->w
|
||||
var graph = iD.Graph([
|
||||
iD.Node({id: 'u'}),
|
||||
iD.Node({id: '*'}),
|
||||
iD.Node({id: 'w'}),
|
||||
iD.Way({id: '=', nodes: ['u', '*'], tags: {highway: 'residential'}}),
|
||||
iD.Way({id: '-', nodes: ['*', 'w'], tags: {highway: 'residential'}}),
|
||||
iD.Relation({id: 'r', tags: {type: 'restriction'}, members: [
|
||||
{id: '=', role: 'from', type: 'way'},
|
||||
{id: '-', role: 'to', type: 'way'},
|
||||
{id: '*', role: 'via', type: 'node'}
|
||||
]})
|
||||
]),
|
||||
action = iD.actionUnrestrictTurn({
|
||||
restriction: 'r'
|
||||
});
|
||||
var graph = iD.coreGraph([
|
||||
iD.osmNode({ id: 'u' }),
|
||||
iD.osmNode({ id: '*' }),
|
||||
iD.osmNode({ id: 'w' }),
|
||||
iD.osmWay({ id: '=', nodes: ['u', '*'], tags: { highway: 'residential' } }),
|
||||
iD.osmWay({ id: '-', nodes: ['*', 'w'], tags: { highway: 'residential' } }),
|
||||
iD.osmRelation({ id: 'r', tags: { type: 'restriction' }, members: [
|
||||
{ id: '=', role: 'from', type: 'way' },
|
||||
{ id: '-', role: 'to', type: 'way' },
|
||||
{ id: '*', role: 'via', type: 'node' }
|
||||
]})
|
||||
]);
|
||||
var action = iD.actionUnrestrictTurn({ restrictionID: 'r' });
|
||||
|
||||
graph = action(graph);
|
||||
|
||||
expect(graph.hasEntity('r')).to.be.undefined;
|
||||
});
|
||||
});
|
||||
|
||||
@@ -338,7 +338,7 @@ describe('iD.osmIntersection', function() {
|
||||
expect(turns[1]).to.be.an.instanceOf(iD.osmTurn);
|
||||
expect(turns[1].key).to.eql('=,*,-');
|
||||
expect(turns[1].u).to.be.not.ok;
|
||||
expect(turns[1].restriction).to.eql('r');
|
||||
expect(turns[1].restrictionID).to.eql('r');
|
||||
expect(turns[1].direct).to.be.true;
|
||||
expect(turns[1].indirect).to.be.not.ok;
|
||||
expect(turns[1].only).to.be.not.ok;
|
||||
@@ -372,7 +372,7 @@ describe('iD.osmIntersection', function() {
|
||||
|
||||
expect(turns[1]).to.be.an.instanceOf(iD.osmTurn);
|
||||
expect(turns[1].key).to.eql('=,*,~');
|
||||
expect(turns[1].restriction).to.eql('r');
|
||||
expect(turns[1].restrictionID).to.eql('r');
|
||||
expect(turns[1].u).to.be.not.ok;
|
||||
expect(turns[1].direct).to.be.not.ok;
|
||||
expect(turns[1].indirect).to.be.true;
|
||||
@@ -380,7 +380,7 @@ describe('iD.osmIntersection', function() {
|
||||
|
||||
expect(turns[2]).to.be.an.instanceOf(iD.osmTurn);
|
||||
expect(turns[2].key).to.eql('=,*,-');
|
||||
expect(turns[2].restriction).to.eql('r');
|
||||
expect(turns[2].restrictionID).to.eql('r');
|
||||
expect(turns[2].u).to.be.not.ok;
|
||||
expect(turns[2].direct).to.be.not.ok;
|
||||
expect(turns[2].indirect).to.be.not.ok;
|
||||
|
||||
Reference in New Issue
Block a user