mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-13 09:12:52 +00:00
- actionRestrictTurn will no longer "infer" the turn type - restrictionType *must* be passed in - this is ok because the only code we use this action (restrictions.js) already has inferred the type - this simplifies what the action actually does - moved the tests from restrict_turn.js that were really just testing the restriction type inferrence over to intersection.js (and added a few more tests for iD.osmInferRestriction)
24 lines
929 B
JavaScript
24 lines
929 B
JavaScript
describe('iD.actionUnrestrictTurn', function() {
|
|
it('removes a restriction from a restricted turn', function() {
|
|
//
|
|
// u === * --- w
|
|
//
|
|
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;
|
|
});
|
|
});
|