mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-31 04:09:33 +02:00
Disconnected highways will now be warning flagged only if unattached to existing highways.
This commit is contained in:
@@ -33,6 +33,22 @@ describe('iD.validations.disconnected_way', function () {
|
||||
);
|
||||
}
|
||||
|
||||
function createWayAtEndOfExistingOne(tags1, tags2) {
|
||||
var n1 = iD.osmNode({id: 'n1', loc: [4,4]});
|
||||
var n2 = iD.osmNode({id: 'n2', loc: [4,5]});
|
||||
var n3 = iD.osmNode({id: 'n-3', loc: [5,5]});
|
||||
var w = iD.osmWay({id: 'w1', nodes: ['n1', 'n2'], tags: tags1});
|
||||
var w2 = iD.osmWay({id: 'w-2', nodes: ['n1', 'n-3'], tags: tags2});
|
||||
|
||||
context.perform(
|
||||
iD.actionAddEntity(n1),
|
||||
iD.actionAddEntity(n2),
|
||||
iD.actionAddEntity(n3),
|
||||
iD.actionAddEntity(w),
|
||||
iD.actionAddEntity(w2)
|
||||
);
|
||||
}
|
||||
|
||||
function validate() {
|
||||
var validator = iD.validationDisconnectedWay();
|
||||
var changes = context.history().changes();
|
||||
@@ -91,8 +107,9 @@ describe('iD.validations.disconnected_way', function () {
|
||||
expect(issue.entities[0].id).to.eql('w-1');
|
||||
});
|
||||
|
||||
it('ignores highways that are connected', function() {
|
||||
createConnectingWays({'highway': 'unclassified'}, {'highway': 'unclassified'});
|
||||
it('ignores highways that are connected to existing highways', function() {
|
||||
createWayAtEndOfExistingOne({'highway': 'secondary'}, {'highway': 'secondary'});
|
||||
|
||||
var issues = validate();
|
||||
expect(issues).to.have.lengthOf(0);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user