mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-15 13:38:26 +02:00
Fix relation role in Split (#694)
This commit is contained in:
@@ -73,7 +73,7 @@ iD.actions.Split = function(nodeId, newWayId) {
|
||||
}
|
||||
}
|
||||
|
||||
relation = relation.addMember({id: wayB.id, type: 'wayA', role: role}, i <= j ? i + 1 : i);
|
||||
relation = relation.addMember({id: wayB.id, type: 'way', role: role}, i <= j ? i + 1 : i);
|
||||
graph = graph.replace(relation);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -175,12 +175,15 @@ describe("iD.actions.Split", function () {
|
||||
'b': iD.Node({id: 'b'}),
|
||||
'c': iD.Node({id: 'c'}),
|
||||
'-': iD.Way({id: '-', nodes: ['a', 'b', 'c']}),
|
||||
'r': iD.Relation({id: 'r', members: [{id: '-', type: 'way'}]})
|
||||
'r': iD.Relation({id: 'r', members: [{id: '-', type: 'way', role: 'forward'}]})
|
||||
});
|
||||
|
||||
graph = iD.actions.Split('b', '=')(graph);
|
||||
|
||||
expect(_.pluck(graph.entity('r').members, 'id')).to.eql(['-', '=']);
|
||||
expect(graph.entity('r').members).to.eql([
|
||||
{id: '-', type: 'way', role: 'forward'},
|
||||
{id: '=', type: 'way', role: 'forward'}
|
||||
]);
|
||||
});
|
||||
|
||||
it("adds the new way to parent relations (forward order)", function () {
|
||||
|
||||
Reference in New Issue
Block a user