From 7ba89ce93e344623d8a041318b76dcb59ad46c25 Mon Sep 17 00:00:00 2001 From: Benjamin Clark Date: Mon, 26 Jul 2021 14:18:37 -0400 Subject: [PATCH] Fix remaining tests. --- modules/osm/node.js | 2 +- test/index.html | 2 +- test/spec/validations/almost_junction.js | 69 ++++++++++---------- test/spec/validations/crossing_ways.js | 35 +++++----- test/spec/validations/disconnected_way.js | 19 +++--- test/spec/validations/incompatible_source.js | 9 ++- test/spec/validations/mismatched_geometry.js | 17 +++-- test/spec/validations/missing_role.js | 13 ++-- test/spec/validations/missing_tag.js | 13 ++-- test/spec/validations/outdated_tags.js | 13 ++-- test/spec/validations/private_data.js | 9 ++- test/spec/validations/suspicious_name.js | 8 ++- 12 files changed, 119 insertions(+), 90 deletions(-) diff --git a/modules/osm/node.js b/modules/osm/node.js index 976a9f89ad..f96bb0f15c 100644 --- a/modules/osm/node.js +++ b/modules/osm/node.js @@ -19,7 +19,7 @@ osmNode.prototype = Object.create(osmEntity.prototype); Object.assign(osmNode.prototype, { type: 'node', - loc: [9999, 9999], + loc: new Extent([9999, 9999]), extent: function() { return new Extent(this.loc); diff --git a/test/index.html b/test/index.html index f64a4e7e70..bd233a06b5 100644 --- a/test/index.html +++ b/test/index.html @@ -160,7 +160,7 @@ 'spec/util/session_mutex.js', 'spec/util/util.js', -// 'spec/validations/almost_junction.js', + 'spec/validations/almost_junction.js', 'spec/validations/crossing_ways.js', 'spec/validations/disconnected_way.js', 'spec/validations/incompatible_source.js', diff --git a/test/spec/validations/almost_junction.js b/test/spec/validations/almost_junction.js index e9a6a2fc40..f335301168 100644 --- a/test/spec/validations/almost_junction.js +++ b/test/spec/validations/almost_junction.js @@ -1,3 +1,6 @@ +const { Extent } = require('@id-sdk/extent'); + + describe('iD.validations.almost_junction', function () { var context; @@ -7,8 +10,8 @@ describe('iD.validations.almost_junction', function () { function horizontalVertialCloserThanThd() { // horizontal road - var n1 = iD.osmNode({id: 'n-1', loc: [22.42357, 0]}); - var n2 = iD.osmNode({id: 'n-2', loc: [22.42367, 0]}); + var n1 = iD.osmNode({id: 'n-1', loc: new Extent([22.42357, 0])}); + var n2 = iD.osmNode({id: 'n-2', loc: new Extent([22.42367, 0])}); var w1 = iD.osmWay({id: 'w-1', nodes: ['n-1', 'n-2'], tags: { highway: 'residential' }}); context.perform( @@ -19,8 +22,8 @@ describe('iD.validations.almost_junction', function () { // vertical road to the west of w1 by 0.00001 longitude degree // 5th digit after decimal point has a resolution of ~1 meter - var n3 = iD.osmNode({id: 'n-3', loc: [22.42356, 0.001]}); - var n4 = iD.osmNode({id: 'n-4', loc: [22.42356, -0.001]}); + var n3 = iD.osmNode({id: 'n-3', loc: new Extent([22.42356, 0.001])}); + var n4 = iD.osmNode({id: 'n-4', loc: new Extent([22.42356, -0.001])}); var w2 = iD.osmWay({id: 'w-2', nodes: ['n-3', 'n-4'], tags: { highway: 'residential' }}); context.perform( @@ -32,8 +35,8 @@ describe('iD.validations.almost_junction', function () { function horizontalTiltedCloserThanThd() { // horizontal road - var n1 = iD.osmNode({id: 'n-1', loc: [22.42357, 0]}); - var n2 = iD.osmNode({id: 'n-2', loc: [22.42367, 0]}); + var n1 = iD.osmNode({id: 'n-1', loc: new Extent([22.42357, 0])}); + var n2 = iD.osmNode({id: 'n-2', loc: new Extent([22.42367, 0])}); var w1 = iD.osmWay({id: 'w-1', nodes: ['n-1', 'n-2'], tags: { highway: 'residential' }}); context.perform( @@ -43,8 +46,8 @@ describe('iD.validations.almost_junction', function () { ); // tilted road to the west of w1 by 0.00001 longitude degree - var n3 = iD.osmNode({id: 'n-3', loc: [22.423555, 0.001]}); - var n4 = iD.osmNode({id: 'n-4', loc: [22.423565, -0.001]}); + var n3 = iD.osmNode({id: 'n-3', loc: new Extent([22.423555, 0.001])}); + var n4 = iD.osmNode({id: 'n-4', loc: new Extent([22.423565, -0.001])}); var w2 = iD.osmWay({id: 'w-2', nodes: ['n-3', 'n-4'], tags: { highway: 'residential' }}); context.perform( @@ -56,8 +59,8 @@ describe('iD.validations.almost_junction', function () { function horizontalVertialFurtherThanThd() { // horizontal road - var n1 = iD.osmNode({id: 'n-1', loc: [22.42357, 0]}); - var n2 = iD.osmNode({id: 'n-2', loc: [22.42367, 0]}); + var n1 = iD.osmNode({id: 'n-1', loc: new Extent([22.42357, 0])}); + var n2 = iD.osmNode({id: 'n-2', loc: new Extent([22.42367, 0])}); var w1 = iD.osmWay({id: 'w-1', nodes: ['n-1', 'n-2'], tags: { highway: 'residential' }}); context.perform( @@ -67,8 +70,8 @@ describe('iD.validations.almost_junction', function () { ); // vertical road to the west of w1 by 0.00007 longitude degree - var n3 = iD.osmNode({id: 'n-3', loc: [22.42350, 0.001]}); - var n4 = iD.osmNode({id: 'n-4', loc: [22.42350, -0.001]}); + var n3 = iD.osmNode({id: 'n-3', loc: new Extent([22.42350, 0.001])}); + var n4 = iD.osmNode({id: 'n-4', loc: new Extent([22.42350, -0.001])}); var w2 = iD.osmWay({id: 'w-2', nodes: ['n-3', 'n-4'], tags: { highway: 'residential' }}); context.perform( @@ -80,8 +83,8 @@ describe('iD.validations.almost_junction', function () { function twoHorizontalCloserThanThd() { // horizontal road - var n1 = iD.osmNode({id: 'n-1', loc: [22.42357, 0]}); - var n2 = iD.osmNode({id: 'n-2', loc: [22.42367, 0]}); + var n1 = iD.osmNode({id: 'n-1', loc: new Extent([22.42357, 0])}); + var n2 = iD.osmNode({id: 'n-2', loc: new Extent([22.42367, 0])}); var w1 = iD.osmWay({id: 'w-1', nodes: ['n-1', 'n-2'], tags: { highway: 'residential' }}); context.perform( @@ -91,8 +94,8 @@ describe('iD.validations.almost_junction', function () { ); // another horizontal road to the north of w1 by 0.0001 latitude degree - var n3 = iD.osmNode({id: 'n-3', loc: [22.42357, 0.00001]}); - var n4 = iD.osmNode({id: 'n-4', loc: [22.42367, 0.00001]}); + var n3 = iD.osmNode({id: 'n-3', loc: new Extent([22.42357, 0.00001])}); + var n4 = iD.osmNode({id: 'n-4', loc: new Extent([22.42367, 0.00001])}); var w2 = iD.osmWay({id: 'w-2', nodes: ['n-3', 'n-4'], tags: { highway: 'residential' }}); context.perform( @@ -104,8 +107,8 @@ describe('iD.validations.almost_junction', function () { function horizontalVertialWithNoExit() { // horizontal road - var n1 = iD.osmNode({id: 'n-1', loc: [22.42357, 0], tags: { noexit: 'yes' }}); - var n2 = iD.osmNode({id: 'n-2', loc: [22.42367, 0]}); + var n1 = iD.osmNode({id: 'n-1', loc: new Extent([22.42357, 0]), tags: { noexit: 'yes' }}); + var n2 = iD.osmNode({id: 'n-2', loc: new Extent([22.42367, 0])}); var w1 = iD.osmWay({id: 'w-1', nodes: ['n-1', 'n-2'], tags: { highway: 'residential' }}); context.perform( @@ -115,8 +118,8 @@ describe('iD.validations.almost_junction', function () { ); // vertical road to the west of w1 by 0.00001 longitude degree - var n3 = iD.osmNode({id: 'n-3', loc: [22.42356, 0.001]}); - var n4 = iD.osmNode({id: 'n-4', loc: [22.42356, -0.001]}); + var n3 = iD.osmNode({id: 'n-3', loc: new Extent([22.42356, 0.001])}); + var n4 = iD.osmNode({id: 'n-4', loc: new Extent([22.42356, -0.001])}); var w2 = iD.osmWay({id: 'w-2', nodes: ['n-3', 'n-4'], tags: { highway: 'residential' }}); context.perform( @@ -128,8 +131,8 @@ describe('iD.validations.almost_junction', function () { function closeEndNodesSmallAngle() { // Vertical path - var n1 = iD.osmNode({id: 'n-1', loc: [0.0003247, 22.4423866]}); - var n2 = iD.osmNode({id: 'n-2', loc: [0.0003060, 22.4432671]}); + var n1 = iD.osmNode({id: 'n-1', loc: new Extent([0.0003247, 22.4423866])}); + var n2 = iD.osmNode({id: 'n-2', loc: new Extent([0.0003060, 22.4432671])}); var w1 = iD.osmWay({id: 'w-1', nodes: ['n-1', 'n-2'], tags: { highway: 'path' }}); context.perform( @@ -139,8 +142,8 @@ describe('iD.validations.almost_junction', function () { ); // Angled path with end node within 4.25m and change of angle <9° - var n3 = iD.osmNode({id: 'n-3', loc: [0.0003379, 22.4423861]}); - var n4 = iD.osmNode({id: 'n-4', loc: [0.0004354, 22.4421312]}); + var n3 = iD.osmNode({id: 'n-3', loc: new Extent([0.0003379, 22.4423861])}); + var n4 = iD.osmNode({id: 'n-4', loc: new Extent([0.0004354, 22.4421312])}); var w2 = iD.osmWay({id: 'w-2', nodes: ['n-3', 'n-4'], tags: { highway: 'path' }}); context.perform( @@ -163,8 +166,8 @@ describe('iD.validations.almost_junction', function () { ); // Horizontal path with end node within 4.25m and change of angle >9° - var n3 = iD.osmNode({id: 'n-3', loc: [0.0000199, 22.4427801]}); - var n4 = iD.osmNode({id: 'n-4', loc: [0.0002038, 22.4427801]}); + var n3 = iD.osmNode({id: 'n-3', loc: new Extent([0.0000199, 22.4427801])}); + var n4 = iD.osmNode({id: 'n-4', loc: new Extent([0.0002038, 22.4427801])}); var w2 = iD.osmWay({id: 'w-2', nodes: ['n-3', 'n-4'], tags: { highway: 'path' }}); context.perform( @@ -178,9 +181,9 @@ describe('iD.validations.almost_junction', function () { // Square path that ends within 4.25m of itself and change of angle <9° var n1 = iD.osmNode({id: 'n-1', loc: [0, 22.4427453]}); var n2 = iD.osmNode({id: 'n-2', loc: [0, 22.4429811]}); - var n3 = iD.osmNode({id: 'n-3', loc: [0.0001923, 22.4429811]}); - var n4 = iD.osmNode({id: 'n-4', loc: [0.0001923, 22.4427523]}); - var n5 = iD.osmNode({id: 'n-5', loc: [0.0000134, 22.4427523]}); + var n3 = iD.osmNode({id: 'n-3', loc: new Extent([0.0001923, 22.4429811])}); + var n4 = iD.osmNode({id: 'n-4', loc: new Extent([0.0001923, 22.4427523])}); + var n5 = iD.osmNode({id: 'n-5', loc: new Extent([0.0000134, 22.4427523])}); var w1 = iD.osmWay({id: 'w-1', nodes: ['n-1', 'n-2', 'n-3', 'n-4', 'n-5'], tags: { highway: 'path' }}); context.perform( @@ -197,8 +200,8 @@ describe('iD.validations.almost_junction', function () { // Square path with both endpoints near each other var n1 = iD.osmNode({id: 'n-1', loc: [0, 22.4427453]}); var n2 = iD.osmNode({id: 'n-2', loc: [0, 22.4429810]}); - var n3 = iD.osmNode({id: 'n-3', loc: [0.0000063, 22.4429810]}); - var n4 = iD.osmNode({id: 'n-4', loc: [0.0000063, 22.4427483]}); + var n3 = iD.osmNode({id: 'n-3', loc: new Extent([0.0000063, 22.4429810])}); + var n4 = iD.osmNode({id: 'n-4', loc: new Extent([0.0000063, 22.4427483])}); var w1 = iD.osmWay({id: 'w-1', nodes: ['n-1', 'n-2', 'n-3', 'n-4'], tags: { highway: 'path' }}); context.perform( @@ -210,8 +213,8 @@ describe('iD.validations.almost_junction', function () { ); // Horizontal path with end node within 4.25m and change of angle >9° (to both endpoints) - var n5 = iD.osmNode({id: 'n-5', loc: [0.0000124, 22.4427458]}); - var n6 = iD.osmNode({id: 'n-6', loc: [0.0000445, 22.4427449]}); + var n5 = iD.osmNode({id: 'n-5', loc: new Extent([0.0000124, 22.4427458])}); + var n6 = iD.osmNode({id: 'n-6', loc: new Extent([0.0000445, 22.4427449])}); var w2 = iD.osmWay({id: 'w-2', nodes: ['n-5', 'n-6'], tags: { highway: 'path' }}); context.perform( diff --git a/test/spec/validations/crossing_ways.js b/test/spec/validations/crossing_ways.js index a511b40a03..19db85cfb4 100644 --- a/test/spec/validations/crossing_ways.js +++ b/test/spec/validations/crossing_ways.js @@ -1,3 +1,6 @@ +const { Extent } = require('@id-sdk/extent'); + + describe('iD.validations.crossing_ways', function () { var context; @@ -6,8 +9,8 @@ describe('iD.validations.crossing_ways', function () { }); function createWaysWithOneCrossingPoint(tags1, tags2) { - var n1 = iD.osmNode({id: 'n-1', loc: [1,1]}); - var n2 = iD.osmNode({id: 'n-2', loc: [2,2]}); + var n1 = iD.osmNode({id: 'n-1', loc: new Extent([1,1])}); + var n2 = iD.osmNode({id: 'n-2', loc: new Extent([2,2])}); var w1 = iD.osmWay({id: 'w-1', nodes: ['n-1', 'n-2'], tags: tags1}); context.perform( @@ -16,8 +19,8 @@ describe('iD.validations.crossing_ways', function () { iD.actionAddEntity(w1) ); - var n3 = iD.osmNode({id: 'n-3', loc: [1,2]}); - var n4 = iD.osmNode({id: 'n-4', loc: [2,1]}); + var n3 = iD.osmNode({id: 'n-3', loc: new Extent([1,2])}); + var n4 = iD.osmNode({id: 'n-4', loc: new Extent([2,1])}); var w2 = iD.osmWay({id: 'w-2', nodes: ['n-3', 'n-4'], tags: tags2}); context.perform( @@ -28,8 +31,8 @@ describe('iD.validations.crossing_ways', function () { } function createWaysWithTwoCrossingPoint() { - var n1 = iD.osmNode({id: 'n-1', loc: [1,1]}); - var n2 = iD.osmNode({id: 'n-2', loc: [3,3]}); + var n1 = iD.osmNode({id: 'n-1', loc: new Extent([1,1])}); + var n2 = iD.osmNode({id: 'n-2', loc: new Extent([3,3])}); var w1 = iD.osmWay({id: 'w-1', nodes: ['n-1', 'n-2'], tags: { highway: 'residential' }}); context.perform( @@ -38,10 +41,10 @@ describe('iD.validations.crossing_ways', function () { iD.actionAddEntity(w1) ); - var n3 = iD.osmNode({id: 'n-3', loc: [1,2]}); - var n4 = iD.osmNode({id: 'n-4', loc: [2,1]}); - var n5 = iD.osmNode({id: 'n-5', loc: [3,2]}); - var n6 = iD.osmNode({id: 'n-6', loc: [2,3]}); + var n3 = iD.osmNode({id: 'n-3', loc: new Extent([1,2])}); + var n4 = iD.osmNode({id: 'n-4', loc: new Extent([2,1])}); + var n5 = iD.osmNode({id: 'n-5', loc: new Extent([3,2])}); + var n6 = iD.osmNode({id: 'n-6', loc: new Extent([2,3])}); var w2 = iD.osmWay({id: 'w-2', nodes: ['n-3', 'n-4', 'n-5', 'n-6'], tags: { highway: 'residential' }}); context.perform( @@ -350,8 +353,8 @@ describe('iD.validations.crossing_ways', function () { }); function createWayAndRelationWithOneCrossingPoint(wayTags, relTags) { - var n1 = iD.osmNode({id: 'n-1', loc: [1,1]}); - var n2 = iD.osmNode({id: 'n-2', loc: [2,2]}); + var n1 = iD.osmNode({id: 'n-1', loc: new Extent([1,1])}); + var n2 = iD.osmNode({id: 'n-2', loc: new Extent([2,2])}); var w1 = iD.osmWay({id: 'w-1', nodes: ['n-1', 'n-2'], tags: wayTags}); context.perform( @@ -360,10 +363,10 @@ describe('iD.validations.crossing_ways', function () { iD.actionAddEntity(w1) ); - var n3 = iD.osmNode({id: 'n-3', loc: [1,2]}); - var n4 = iD.osmNode({id: 'n-4', loc: [2,1]}); - var n5 = iD.osmNode({id: 'n-5', loc: [3,2]}); - var n6 = iD.osmNode({id: 'n-6', loc: [2,3]}); + var n3 = iD.osmNode({id: 'n-3', loc: new Extent([1,2])}); + var n4 = iD.osmNode({id: 'n-4', loc: new Extent([2,1])}); + var n5 = iD.osmNode({id: 'n-5', loc: new Extent([3,2])}); + var n6 = iD.osmNode({id: 'n-6', loc: new Extent([2,3])}); var w2 = iD.osmWay({id: 'w-2', nodes: ['n-3', 'n-4', 'n-5'], tags: {}}); var w3 = iD.osmWay({id: 'w-3', nodes: ['n-5', 'n-6', 'n-3'], tags: {}}); var r1 = iD.osmRelation({id: 'r-1', members: [{id: 'w-2', type: 'way'}, {id: 'w-3', type: 'way'}], tags: relTags}); diff --git a/test/spec/validations/disconnected_way.js b/test/spec/validations/disconnected_way.js index e10eab3310..4c41c5b09a 100644 --- a/test/spec/validations/disconnected_way.js +++ b/test/spec/validations/disconnected_way.js @@ -1,3 +1,6 @@ +const { Extent } = require('@id-sdk/extent'); + + describe('iD.validations.disconnected_way', function () { var context; @@ -6,8 +9,8 @@ describe('iD.validations.disconnected_way', function () { }); function createWay(tags) { - var n1 = iD.osmNode({id: 'n-1', loc: [4,4]}); - var n2 = iD.osmNode({id: 'n-2', loc: [4,5]}); + var n1 = iD.osmNode({id: 'n-1', loc: new Extent([4,4])}); + var n2 = iD.osmNode({id: 'n-2', loc: new Extent([4,5])}); var w = iD.osmWay({id: 'w-1', nodes: ['n-1', 'n-2'], tags: tags}); context.perform( @@ -18,9 +21,9 @@ describe('iD.validations.disconnected_way', function () { } function createConnectingWays(tags1, tags2) { - var n1 = iD.osmNode({id: 'n-1', loc: [4,4]}); - var n2 = iD.osmNode({id: 'n-2', loc: [4,5]}); - var n3 = iD.osmNode({id: 'n-3', loc: [5,5]}); + var n1 = iD.osmNode({id: 'n-1', loc: new Extent([4,4])}); + var n2 = iD.osmNode({id: 'n-2', loc: new Extent([4,5])}); + var n3 = iD.osmNode({id: 'n-3', loc: new Extent([5,5])}); var w = iD.osmWay({id: 'w-1', nodes: ['n-1', 'n-2'], tags: tags1}); var w2 = iD.osmWay({id: 'w-2', nodes: ['n-1', 'n-3'], tags: tags2}); @@ -75,9 +78,9 @@ describe('iD.validations.disconnected_way', function () { it('ignores highway with connected entrance vertex', function() { - var n1 = iD.osmNode({id: 'n-1', loc: [4,4], tags: {'entrance': 'yes'}}); - var n2 = iD.osmNode({id: 'n-2', loc: [4,5]}); - var n3 = iD.osmNode({id: 'n-3', loc: [5,5]}); + var n1 = iD.osmNode({id: 'n-1', loc: new Extent([4,4]), tags: {'entrance': 'yes'}}); + var n2 = iD.osmNode({id: 'n-2', loc: new Extent([4,5])}); + var n3 = iD.osmNode({id: 'n-3', loc: new Extent([5,5])}); var w = iD.osmWay({id: 'w-1', nodes: ['n-1', 'n-2'], tags: {'highway': 'unclassified'}}); var w2 = iD.osmWay({id: 'w-2', nodes: ['n-1', 'n-3']}); diff --git a/test/spec/validations/incompatible_source.js b/test/spec/validations/incompatible_source.js index 1801ac2634..cc9e5073b9 100644 --- a/test/spec/validations/incompatible_source.js +++ b/test/spec/validations/incompatible_source.js @@ -1,3 +1,6 @@ +const { Extent } = require('@id-sdk/extent'); + + describe('iD.validations.incompatible_source', function () { var context; @@ -6,9 +9,9 @@ describe('iD.validations.incompatible_source', function () { }); function createWay(tags) { - var n1 = iD.osmNode({id: 'n-1', loc: [4,4]}); - var n2 = iD.osmNode({id: 'n-2', loc: [4,5]}); - var n3 = iD.osmNode({id: 'n-3', loc: [5,5]}); + var n1 = iD.osmNode({id: 'n-1', loc: new Extent([4,4])}); + var n2 = iD.osmNode({id: 'n-2', loc: new Extent([4,5])}); + var n3 = iD.osmNode({id: 'n-3', loc: new Extent([5,5])}); var w = iD.osmWay({id: 'w-1', nodes: ['n-1', 'n-2', 'n-3'], tags: tags}); context.perform( diff --git a/test/spec/validations/mismatched_geometry.js b/test/spec/validations/mismatched_geometry.js index 16a907122a..4e4bdd0506 100644 --- a/test/spec/validations/mismatched_geometry.js +++ b/test/spec/validations/mismatched_geometry.js @@ -1,3 +1,6 @@ +const { Extent } = require('@id-sdk/extent'); + + describe('iD.validations.mismatched_geometry', function () { var context, _savedAreaKeys; @@ -12,16 +15,16 @@ describe('iD.validations.mismatched_geometry', function () { function createPoint(tags) { - var n1 = iD.osmNode({id: 'n-1', loc: [4,4], tags: tags}); + var n1 = iD.osmNode({id: 'n-1', loc: new Extent([4,4]), tags: tags}); context.perform( iD.actionAddEntity(n1) ); } function createOpenWay(tags) { - var n1 = iD.osmNode({id: 'n-1', loc: [4,4]}); - var n2 = iD.osmNode({id: 'n-2', loc: [4,5]}); - var n3 = iD.osmNode({id: 'n-3', loc: [5,5]}); + var n1 = iD.osmNode({id: 'n-1', loc: new Extent([4,4])}); + var n2 = iD.osmNode({id: 'n-2', loc: new Extent([4,5])}); + var n3 = iD.osmNode({id: 'n-3', loc: new Extent([5,5])}); var w = iD.osmWay({id: 'w-1', nodes: ['n-1', 'n-2', 'n-3'], tags: tags}); context.perform( @@ -33,9 +36,9 @@ describe('iD.validations.mismatched_geometry', function () { } function createClosedWay(tags) { - var n1 = iD.osmNode({id: 'n-1', loc: [4,4]}); - var n2 = iD.osmNode({id: 'n-2', loc: [4,5]}); - var n3 = iD.osmNode({id: 'n-3', loc: [5,5]}); + var n1 = iD.osmNode({id: 'n-1', loc: new Extent([4,4])}); + var n2 = iD.osmNode({id: 'n-2', loc: new Extent([4,5])}); + var n3 = iD.osmNode({id: 'n-3', loc: new Extent([5,5])}); var w = iD.osmWay({id: 'w-1', nodes: ['n-1', 'n-2', 'n-3', 'n-1'], tags: tags}); context.perform( diff --git a/test/spec/validations/missing_role.js b/test/spec/validations/missing_role.js index de63a4ecd6..e99ee2eb21 100644 --- a/test/spec/validations/missing_role.js +++ b/test/spec/validations/missing_role.js @@ -1,3 +1,6 @@ +const { Extent } = require('@id-sdk/extent'); + + describe('iD.validations.missing_role', function () { var context; @@ -6,8 +9,8 @@ describe('iD.validations.missing_role', function () { }); function createWay(tags) { - var n1 = iD.osmNode({id: 'n-1', loc: [4,4]}); - var n2 = iD.osmNode({id: 'n-2', loc: [4,5]}); + var n1 = iD.osmNode({id: 'n-1', loc: new Extent([4,4])}); + var n2 = iD.osmNode({id: 'n-2', loc: new Extent([4,5])}); var w = iD.osmWay({id: 'w-1', nodes: ['n-1', 'n-2'], tags: tags}); context.perform( @@ -18,9 +21,9 @@ describe('iD.validations.missing_role', function () { } function createRelation(tags, role) { - var n1 = iD.osmNode({id: 'n-1', loc: [4,4]}); - var n2 = iD.osmNode({id: 'n-2', loc: [4,5]}); - var n3 = iD.osmNode({id: 'n-3', loc: [5,5]}); + var n1 = iD.osmNode({id: 'n-1', loc: new Extent([4,4])}); + var n2 = iD.osmNode({id: 'n-2', loc: new Extent([4,5])}); + var n3 = iD.osmNode({id: 'n-3', loc: new Extent([5,5])}); var w = iD.osmWay({id: 'w-1', nodes: ['n-1', 'n-2', 'n-3', 'n-1']}); var r = iD.osmRelation({id: 'r-1', members: [{id: 'w-1', role: role}], tags: tags}); diff --git a/test/spec/validations/missing_tag.js b/test/spec/validations/missing_tag.js index 94aa7fe76f..26346e34e1 100644 --- a/test/spec/validations/missing_tag.js +++ b/test/spec/validations/missing_tag.js @@ -1,3 +1,6 @@ +const { Extent } = require('@id-sdk/extent'); + + describe('iD.validations.missing_tag', function () { var context; @@ -6,8 +9,8 @@ describe('iD.validations.missing_tag', function () { }); function createWay(tags) { - var n1 = iD.osmNode({id: 'n-1', loc: [4,4]}); - var n2 = iD.osmNode({id: 'n-2', loc: [4,5]}); + var n1 = iD.osmNode({id: 'n-1', loc: new Extent([4,4])}); + var n2 = iD.osmNode({id: 'n-2', loc: new Extent([4,5])}); var w = iD.osmWay({id: 'w-1', nodes: ['n-1', 'n-2'], tags: tags}); context.perform( @@ -18,9 +21,9 @@ describe('iD.validations.missing_tag', function () { } function createRelation(tags) { - var n1 = iD.osmNode({id: 'n-1', loc: [4,4]}); - var n2 = iD.osmNode({id: 'n-2', loc: [4,5]}); - var n3 = iD.osmNode({id: 'n-3', loc: [5,5]}); + var n1 = iD.osmNode({id: 'n-1', loc: new Extent([4,4])}); + var n2 = iD.osmNode({id: 'n-2', loc: new Extent([4,5])}); + var n3 = iD.osmNode({id: 'n-3', loc: new Extent([5,5])}); var w = iD.osmWay({id: 'w-1', nodes: ['n-1', 'n-2', 'n-3', 'n-1']}); var r = iD.osmRelation({id: 'r-1', members: [{id: 'w-1'}], tags: tags}); diff --git a/test/spec/validations/outdated_tags.js b/test/spec/validations/outdated_tags.js index 6f5d042e4b..1f90ec4cd6 100644 --- a/test/spec/validations/outdated_tags.js +++ b/test/spec/validations/outdated_tags.js @@ -1,3 +1,6 @@ +const { Extent } = require('@id-sdk/extent'); + + describe('iD.validations.outdated_tags', function () { var context; @@ -18,8 +21,8 @@ describe('iD.validations.outdated_tags', function () { function createWay(tags) { - var n1 = iD.osmNode({id: 'n-1', loc: [4,4]}); - var n2 = iD.osmNode({id: 'n-2', loc: [4,5]}); + var n1 = iD.osmNode({id: 'n-1', loc: new Extent([4,4])}); + var n2 = iD.osmNode({id: 'n-2', loc: new Extent([4,5])}); var w = iD.osmWay({id: 'w-1', nodes: ['n-1', 'n-2'], tags: tags}); context.perform( @@ -30,9 +33,9 @@ describe('iD.validations.outdated_tags', function () { } function createRelation(wayTags, relationTags) { - var n1 = iD.osmNode({id: 'n-1', loc: [4,4]}); - var n2 = iD.osmNode({id: 'n-2', loc: [4,5]}); - var n3 = iD.osmNode({id: 'n-3', loc: [5,5]}); + var n1 = iD.osmNode({id: 'n-1', loc: new Extent([4,4])}); + var n2 = iD.osmNode({id: 'n-2', loc: new Extent([4,5])}); + var n3 = iD.osmNode({id: 'n-3', loc: new Extent([5,5])}); var w = iD.osmWay({id: 'w-1', nodes: ['n-1', 'n-2', 'n-3', 'n-1'], tags: wayTags}); var r = iD.osmRelation({id: 'r-1', members: [{id: 'w-1'}], tags: relationTags}); diff --git a/test/spec/validations/private_data.js b/test/spec/validations/private_data.js index bafbe03001..452850671b 100644 --- a/test/spec/validations/private_data.js +++ b/test/spec/validations/private_data.js @@ -1,3 +1,6 @@ +const { Extent } = require('@id-sdk/extent'); + + describe('iD.validations.private_data', function () { var context; @@ -6,9 +9,9 @@ describe('iD.validations.private_data', function () { }); function createWay(tags) { - var n1 = iD.osmNode({id: 'n-1', loc: [4,4]}); - var n2 = iD.osmNode({id: 'n-2', loc: [4,5]}); - var n3 = iD.osmNode({id: 'n-3', loc: [5,5]}); + var n1 = iD.osmNode({id: 'n-1', loc: new Extent([4,4])}); + var n2 = iD.osmNode({id: 'n-2', loc: new Extent([4,5])}); + var n3 = iD.osmNode({id: 'n-3', loc: new Extent([5,5])}); var w = iD.osmWay({id: 'w-1', nodes: ['n-1', 'n-2', 'n-3'], tags: tags}); context.perform( diff --git a/test/spec/validations/suspicious_name.js b/test/spec/validations/suspicious_name.js index 66b6446eea..0e1278530d 100644 --- a/test/spec/validations/suspicious_name.js +++ b/test/spec/validations/suspicious_name.js @@ -1,3 +1,5 @@ +const { Extent } = require('@id-sdk/extent'); + describe('iD.validations.suspicious_name', function () { var context; @@ -42,9 +44,9 @@ describe('iD.validations.suspicious_name', function () { }); function createWay(tags) { - var n1 = iD.osmNode({id: 'n-1', loc: [4,4]}); - var n2 = iD.osmNode({id: 'n-2', loc: [4,5]}); - var n3 = iD.osmNode({id: 'n-3', loc: [5,5]}); + var n1 = iD.osmNode({id: 'n-1', loc: new Extent([4,4])}); + var n2 = iD.osmNode({id: 'n-2', loc: new Extent([4,5])}); + var n3 = iD.osmNode({id: 'n-3', loc: new Extent([5,5])}); var w = iD.osmWay({id: 'w-1', nodes: ['n-1', 'n-2', 'n-3'], tags: tags}); context.perform(