From 919687d2cf5a8cb58ef5aeadf2b79631962c385e Mon Sep 17 00:00:00 2001 From: Bryan Housel Date: Fri, 21 Feb 2020 23:12:25 -0500 Subject: [PATCH] Replace legacy names still used in tests, remove the legacy exports --- API.md | 2 +- CHANGELOG.md | 4 +- modules/index.js | 28 +------ test/bench/node-xml.html | 2 +- test/spec/actions/add_entity.js | 2 +- test/spec/actions/change_tags.js | 2 +- test/spec/actions/straighten_way.js | 116 ++++++++++++++-------------- test/spec/actions/upgrade_tags.js | 24 +++--- test/spec/core/graph.js | 6 +- test/spec/core/history.js | 18 ++--- test/spec/renderer/tile_layer.js | 4 +- 11 files changed, 91 insertions(+), 117 deletions(-) diff --git a/API.md b/API.md index 8dfc397a8..a0ba26bbe 100644 --- a/API.md +++ b/API.md @@ -81,7 +81,7 @@ vocabulary established by iD, and to the tags present on OSM entities. ### OSM Data Model classes -An SVG element on the map to which an iD.Entity has been bound as a datum shall +An SVG element on the map to which an iD.osmEntity has been bound as a datum shall have a class with that datum's type, i.e. either `.node` or `.way`. (If and when we add visual representations for relations, `.relation` may also be valid.) diff --git a/CHANGELOG.md b/CHANGELOG.md index d4e62067a..aec098084 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5349,8 +5349,8 @@ _Map traffic signals, stop signs, benches, crossings, street lamps, fountains, t ##### 2013-Nov-22 * Support for loading GPX-files via url parameter (#1965) * Update osm-auth (#1904) -* Update 3rd party dependencies (Lo-Dash, D3, RBush) -* Build iD.Way.areaKeys from presets +* Update 3rd party dependencies (Lodash, D3, RBush) +* Build areaKeys from presets * Add public_transport, military, emankment presets * Reverse cardinal directions for relation member roles * Improved warning visibility (#1973) diff --git a/modules/index.js b/modules/index.js index fb581e3ac..3c9a7a45c 100644 --- a/modules/index.js +++ b/modules/index.js @@ -22,30 +22,4 @@ export * from './ui/index'; export * from './util/index'; export * from './validations/index'; -/* export some legacy symbols: */ -import { services } from './services/index'; -var Connection = services.osm; -export { Connection }; -export { coreContext as Context } from './core/context'; -export { osmSetAreaKeys as setAreaKeys, osmAreaKeys as areaKeys } from './osm/tags'; -export { coreDifference as Difference } from './core/difference'; -export { coreGraph as Graph } from './core/graph'; -export { coreHistory as History } from './core/history'; -export { coreTree as Tree } from './core/tree'; -export { geoVecCross as geoCross } from './geo/vector'; -export { geoVecInterp as geoInterp } from './geo/vector'; -export { geoVecFloor as geoRoundCoordinates } from './geo/vector'; -export { geoVecLength as geoEuclideanDistance } from './geo/vector'; -export { osmEntity as Entity } from './osm/entity'; -export { osmNode as Node } from './osm/node'; -export { osmRelation as Relation } from './osm/relation'; -export { osmWay as Way } from './osm/way'; -export { rendererBackgroundSource as BackgroundSource } from './renderer/background_source'; -export { rendererBackground as Background } from './renderer/background'; -export { rendererFeatures as Features } from './renderer/features'; -export { rendererMap as Map } from './renderer/map'; -export { rendererTileLayer as TileLayer } from './renderer/tile_layer'; -export { utilDetect as Detect } from './util/detect'; -export { uiSectionPresetFields as uiPreset } from './ui/sections/preset_fields'; - -export var debug = false; +export let debug = false; diff --git a/test/bench/node-xml.html b/test/bench/node-xml.html index 174738350..8fc9d33d0 100644 --- a/test/bench/node-xml.html +++ b/test/bench/node-xml.html @@ -78,7 +78,7 @@ .add('four', function() { var o = { type: 'node', loc: [0, 0] }, attrs = obj.attributes; - o.id = attrs.id.nodeValue; + o.id = attrs.iD.osmNodeValue; o.loc[0] = parseFloat(attrs.lon.nodeValue); o.loc[1] = parseFloat(attrs.lat.nodeValue); o.version = attrs.version.nodeValue; diff --git a/test/spec/actions/add_entity.js b/test/spec/actions/add_entity.js index 8c86981f5..740bfeef1 100644 --- a/test/spec/actions/add_entity.js +++ b/test/spec/actions/add_entity.js @@ -1,6 +1,6 @@ describe('iD.actionAddEntity', function () { it('adds an entity to the graph', function () { - var entity = iD.Entity(), + var entity = iD.osmEntity(), graph = iD.actionAddEntity(entity)(iD.coreGraph()); expect(graph.entity(entity.id)).to.equal(entity); }); diff --git a/test/spec/actions/change_tags.js b/test/spec/actions/change_tags.js index 17e544f7d..d688c4d1d 100644 --- a/test/spec/actions/change_tags.js +++ b/test/spec/actions/change_tags.js @@ -1,6 +1,6 @@ describe('iD.actionChangeTags', function () { it('changes an entity\'s tags', function () { - var entity = iD.Entity(), + var entity = iD.osmEntity(), tags = {foo: 'bar'}, graph = iD.actionChangeTags(entity.id, tags)(iD.coreGraph([entity])); expect(graph.entity(entity.id).tags).to.eql(tags); diff --git a/test/spec/actions/straighten_way.js b/test/spec/actions/straighten_way.js index 544121530..d9e2ce4c6 100644 --- a/test/spec/actions/straighten_way.js +++ b/test/spec/actions/straighten_way.js @@ -39,11 +39,11 @@ describe('iD.actionStraightenWay', function () { it('deletes empty nodes', function() { var graph = iD.coreGraph([ - iD.osmNode({id: 'a', loc: [0, 0]}), - iD.osmNode({id: 'b', loc: [1, 0.01], tags: {}}), - iD.osmNode({id: 'c', loc: [2, 0]}), - iD.osmWay({id: '-', nodes: ['a', 'b', 'c']}) - ]); + iD.osmNode({id: 'a', loc: [0, 0]}), + iD.osmNode({id: 'b', loc: [1, 0.01], tags: {}}), + iD.osmNode({id: 'c', loc: [2, 0]}), + iD.osmWay({id: '-', nodes: ['a', 'b', 'c']}) + ]); graph = iD.actionStraightenWay(['-'], projection)(graph); expect(graph.entity('-').nodes).to.eql(['a', 'c']); @@ -52,11 +52,11 @@ describe('iD.actionStraightenWay', function () { it('does not delete tagged nodes', function() { var graph = iD.coreGraph([ - iD.osmNode({id: 'a', loc: [0, 0]}), - iD.osmNode({id: 'b', loc: [1, 0.01], tags: {foo: 'bar'}}), - iD.osmNode({id: 'c', loc: [2, 0]}), - iD.osmWay({id: '-', nodes: ['a', 'b', 'c']}) - ]); + iD.osmNode({id: 'a', loc: [0, 0]}), + iD.osmNode({id: 'b', loc: [1, 0.01], tags: {foo: 'bar'}}), + iD.osmNode({id: 'c', loc: [2, 0]}), + iD.osmWay({id: '-', nodes: ['a', 'b', 'c']}) + ]); graph = iD.actionStraightenWay(['-'], projection)(graph); expect(graph.entity('-').nodes).to.eql(['a', 'b', 'c']); @@ -66,12 +66,12 @@ describe('iD.actionStraightenWay', function () { it('does not delete nodes connected to other ways', function() { var graph = iD.coreGraph([ - iD.osmNode({id: 'a', loc: [0, 0]}), - iD.osmNode({id: 'b', loc: [1, 0.01]}), - iD.osmNode({id: 'c', loc: [2, 0]}), - iD.osmWay({id: '-', nodes: ['a', 'b', 'c']}), - iD.osmWay({id: '=', nodes: ['b']}) - ]); + iD.osmNode({id: 'a', loc: [0, 0]}), + iD.osmNode({id: 'b', loc: [1, 0.01]}), + iD.osmNode({id: 'c', loc: [2, 0]}), + iD.osmWay({id: '-', nodes: ['a', 'b', 'c']}), + iD.osmWay({id: '=', nodes: ['b']}) + ]); graph = iD.actionStraightenWay(['-'], projection)(graph); expect(graph.entity('-').nodes).to.eql(['a', 'b', 'c']); @@ -80,19 +80,19 @@ describe('iD.actionStraightenWay', function () { }); it('straightens multiple, connected ways', function() { - var graph = iD.Graph([ - iD.Node({id: 'a', loc: [0, 0]}), - iD.Node({id: 'b', loc: [1, 0.01], tags: {foo: 'bar'}}), - iD.Node({id: 'c', loc: [2, -0.01]}), - iD.Node({id: 'd', loc: [3, 0]}), - iD.Way({id: '-', nodes: ['a', 'b', 'c', 'd']}), + var graph = iD.coreGraph([ + iD.osmNode({id: 'a', loc: [0, 0]}), + iD.osmNode({id: 'b', loc: [1, 0.01], tags: {foo: 'bar'}}), + iD.osmNode({id: 'c', loc: [2, -0.01]}), + iD.osmNode({id: 'd', loc: [3, 0]}), + iD.osmWay({id: '-', nodes: ['a', 'b', 'c', 'd']}), - iD.Node({id: 'e', loc: [4, 0]}), - iD.Node({id: 'f', loc: [5, 0.01], tags: {foo: 'bar'}}), - iD.Node({id: 'g', loc: [6, -0.01]}), - iD.Node({id: 'h', loc: [7, 0]}), - iD.Way({id: '--', nodes: ['d', 'e', 'f', 'g', 'h']}) - ]); + iD.osmNode({id: 'e', loc: [4, 0]}), + iD.osmNode({id: 'f', loc: [5, 0.01], tags: {foo: 'bar'}}), + iD.osmNode({id: 'g', loc: [6, -0.01]}), + iD.osmNode({id: 'h', loc: [7, 0]}), + iD.osmWay({id: '--', nodes: ['d', 'e', 'f', 'g', 'h']}) + ]); graph = iD.actionStraightenWay(['-', '--'], projection)(graph); expect(graph.entity('-').nodes).to.eql(['a', 'b', 'd']); @@ -103,19 +103,19 @@ describe('iD.actionStraightenWay', function () { }); it('straightens multiple, connected ways going in different directions', function() { - var graph = iD.Graph([ - iD.Node({id: 'a', loc: [0, 0]}), - iD.Node({id: 'b', loc: [1, 0.01], tags: {foo: 'bar'}}), - iD.Node({id: 'c', loc: [2, -0.01]}), - iD.Node({id: 'd', loc: [3, 0]}), - iD.Way({id: '-', nodes: ['a', 'b', 'c', 'd']}), + var graph = iD.coreGraph([ + iD.osmNode({id: 'a', loc: [0, 0]}), + iD.osmNode({id: 'b', loc: [1, 0.01], tags: {foo: 'bar'}}), + iD.osmNode({id: 'c', loc: [2, -0.01]}), + iD.osmNode({id: 'd', loc: [3, 0]}), + iD.osmWay({id: '-', nodes: ['a', 'b', 'c', 'd']}), - iD.Node({id: 'e', loc: [4, 0]}), - iD.Node({id: 'f', loc: [5, 0.01], tags: {foo: 'bar'}}), - iD.Node({id: 'g', loc: [6, -0.01]}), - iD.Node({id: 'h', loc: [7, 0]}), - iD.Way({id: '--', nodes: ['h', 'g', 'f', 'e', 'd']}) - ]); + iD.osmNode({id: 'e', loc: [4, 0]}), + iD.osmNode({id: 'f', loc: [5, 0.01], tags: {foo: 'bar'}}), + iD.osmNode({id: 'g', loc: [6, -0.01]}), + iD.osmNode({id: 'h', loc: [7, 0]}), + iD.osmWay({id: '--', nodes: ['h', 'g', 'f', 'e', 'd']}) + ]); graph = iD.actionStraightenWay(['-', '--'], projection)(graph); expect(graph.entity('-').nodes).to.eql(['a', 'b', 'd']); @@ -132,12 +132,12 @@ describe('iD.actionStraightenWay', function () { it('straighten at t = 0', function() { var graph = iD.coreGraph([ - iD.osmNode({id: 'a', loc: [0, 0]}), - iD.osmNode({id: 'b', loc: [1, 0.01], tags: {foo: 'bar'}}), - iD.osmNode({id: 'c', loc: [2, -0.01]}), - iD.osmNode({id: 'd', loc: [3, 0]}), - iD.osmWay({id: '-', nodes: ['a', 'b', 'c', 'd']}) - ]); + iD.osmNode({id: 'a', loc: [0, 0]}), + iD.osmNode({id: 'b', loc: [1, 0.01], tags: {foo: 'bar'}}), + iD.osmNode({id: 'c', loc: [2, -0.01]}), + iD.osmNode({id: 'd', loc: [3, 0]}), + iD.osmWay({id: '-', nodes: ['a', 'b', 'c', 'd']}) + ]); graph = iD.actionStraightenWay(['-'], projection)(graph, 0); expect(graph.entity('-').nodes).to.eql(['a', 'b', 'c', 'd']); @@ -149,12 +149,12 @@ describe('iD.actionStraightenWay', function () { it('straighten at t = 0.5', function() { var graph = iD.coreGraph([ - iD.osmNode({id: 'a', loc: [0, 0]}), - iD.osmNode({id: 'b', loc: [1, 0.01], tags: {foo: 'bar'}}), - iD.osmNode({id: 'c', loc: [2, -0.01]}), - iD.osmNode({id: 'd', loc: [3, 0]}), - iD.osmWay({id: '-', nodes: ['a', 'b', 'c', 'd']}) - ]); + iD.osmNode({id: 'a', loc: [0, 0]}), + iD.osmNode({id: 'b', loc: [1, 0.01], tags: {foo: 'bar'}}), + iD.osmNode({id: 'c', loc: [2, -0.01]}), + iD.osmNode({id: 'd', loc: [3, 0]}), + iD.osmWay({id: '-', nodes: ['a', 'b', 'c', 'd']}) + ]); graph = iD.actionStraightenWay(['-'], projection)(graph, 0.5); expect(graph.entity('-').nodes).to.eql(['a', 'b', 'c', 'd']); @@ -166,12 +166,12 @@ describe('iD.actionStraightenWay', function () { it('straighten at t = 1', function() { var graph = iD.coreGraph([ - iD.osmNode({id: 'a', loc: [0, 0]}), - iD.osmNode({id: 'b', loc: [1, 0.01], tags: {foo: 'bar'}}), - iD.osmNode({id: 'c', loc: [2, -0.01]}), - iD.osmNode({id: 'd', loc: [3, 0]}), - iD.osmWay({id: '-', nodes: ['a', 'b', 'c', 'd']}) - ]); + iD.osmNode({id: 'a', loc: [0, 0]}), + iD.osmNode({id: 'b', loc: [1, 0.01], tags: {foo: 'bar'}}), + iD.osmNode({id: 'c', loc: [2, -0.01]}), + iD.osmNode({id: 'd', loc: [3, 0]}), + iD.osmWay({id: '-', nodes: ['a', 'b', 'c', 'd']}) + ]); graph = iD.actionStraightenWay(['-'], projection)(graph, 1); expect(graph.entity('-').nodes).to.eql(['a', 'b', 'd']); diff --git a/test/spec/actions/upgrade_tags.js b/test/spec/actions/upgrade_tags.js index b5b8fe44b..ae6ea1a8a 100644 --- a/test/spec/actions/upgrade_tags.js +++ b/test/spec/actions/upgrade_tags.js @@ -3,7 +3,7 @@ describe('iD.actionUpgradeTags', function () { it('upgrades a tag', function () { var oldTags = { amenity: 'swimming_pool' }, newTags = { leisure: 'swimming_pool' }, - entity = iD.Entity({ tags: { amenity: 'swimming_pool', name: 'Foo' }}), + entity = iD.osmEntity({ tags: { amenity: 'swimming_pool', name: 'Foo' }}), graph = iD.actionUpgradeTags(entity.id, oldTags, newTags)(iD.coreGraph([entity])); expect(graph.entity(entity.id).tags).to.eql({ leisure: 'swimming_pool', name: 'Foo' }); }); @@ -11,7 +11,7 @@ describe('iD.actionUpgradeTags', function () { it('upgrades a tag combination', function () { var oldTags = { amenity: 'vending_machine', vending: 'news_papers' }, newTags = { amenity: 'vending_machine', vending: 'newspapers' }, - entity = iD.Entity({ tags: { amenity: 'vending_machine', vending: 'news_papers', name: 'Foo' }}), + entity = iD.osmEntity({ tags: { amenity: 'vending_machine', vending: 'news_papers', name: 'Foo' }}), graph = iD.actionUpgradeTags(entity.id, oldTags, newTags)(iD.coreGraph([entity])); expect(graph.entity(entity.id).tags).to.eql({ amenity: 'vending_machine', vending: 'newspapers', name: 'Foo' }); }); @@ -19,7 +19,7 @@ describe('iD.actionUpgradeTags', function () { it('upgrades a tag with multiple replacement tags', function () { var oldTags = { natural: 'marsh' }, newTags = { natural: 'wetland', wetland: 'marsh' }, - entity = iD.Entity({ tags: { natural: 'marsh', name: 'Foo' }}), + entity = iD.osmEntity({ tags: { natural: 'marsh', name: 'Foo' }}), graph = iD.actionUpgradeTags(entity.id, oldTags, newTags)(iD.coreGraph([entity])); expect(graph.entity(entity.id).tags).to.eql({ natural: 'wetland', wetland: 'marsh', name: 'Foo' }); }); @@ -27,7 +27,7 @@ describe('iD.actionUpgradeTags', function () { it('upgrades a tag and overrides an existing value', function () { var oldTags = { landuse: 'wood' }, newTags = { natural: 'wood' }, - entity = iD.Entity({ tags: { landuse: 'wood', natural: 'wetland', name: 'Foo' }}), + entity = iD.osmEntity({ tags: { landuse: 'wood', natural: 'wetland', name: 'Foo' }}), graph = iD.actionUpgradeTags(entity.id, oldTags, newTags)(iD.coreGraph([entity])); expect(graph.entity(entity.id).tags).to.eql({ natural: 'wood', name: 'Foo' }); }); @@ -35,7 +35,7 @@ describe('iD.actionUpgradeTags', function () { it('upgrades a tag with no replacement tags', function () { var oldTags = { highway: 'no' }, newTags = undefined, - entity = iD.Entity({ tags: { highway: 'no', name: 'Foo' }}), + entity = iD.osmEntity({ tags: { highway: 'no', name: 'Foo' }}), graph = iD.actionUpgradeTags(entity.id, oldTags, newTags)(iD.coreGraph([entity])); expect(graph.entity(entity.id).tags).to.eql({ name: 'Foo' }); }); @@ -43,7 +43,7 @@ describe('iD.actionUpgradeTags', function () { it('upgrades a wildcard tag and moves the value', function () { var oldTags = { color: '*' }, newTags = { colour: '$1' }, - entity = iD.Entity({ tags: { color: 'red', name: 'Foo' }}), + entity = iD.osmEntity({ tags: { color: 'red', name: 'Foo' }}), graph = iD.actionUpgradeTags(entity.id, oldTags, newTags)(iD.coreGraph([entity])); expect(graph.entity(entity.id).tags).to.eql({ colour: 'red', name: 'Foo' }); }); @@ -51,7 +51,7 @@ describe('iD.actionUpgradeTags', function () { it('upgrades a tag with a wildcard replacement and adds a default value', function () { var oldTags = { amenity: 'shop' }, newTags = { shop: '*' }, - entity = iD.Entity({ tags: { amenity: 'shop', name: 'Foo' }}), + entity = iD.osmEntity({ tags: { amenity: 'shop', name: 'Foo' }}), graph = iD.actionUpgradeTags(entity.id, oldTags, newTags)(iD.coreGraph([entity])); expect(graph.entity(entity.id).tags).to.eql({ shop: 'yes', name: 'Foo' }); }); @@ -59,7 +59,7 @@ describe('iD.actionUpgradeTags', function () { it('upgrades a tag with a wildcard replacement and maintains the existing value', function () { var oldTags = { amenity: 'shop' }, newTags = { shop: '*' }, - entity = iD.Entity({ tags: { amenity: 'shop', shop: 'supermarket', name: 'Foo' }}), + entity = iD.osmEntity({ tags: { amenity: 'shop', shop: 'supermarket', name: 'Foo' }}), graph = iD.actionUpgradeTags(entity.id, oldTags, newTags)(iD.coreGraph([entity])); expect(graph.entity(entity.id).tags).to.eql({ shop: 'supermarket', name: 'Foo' }); }); @@ -67,7 +67,7 @@ describe('iD.actionUpgradeTags', function () { it('upgrades a tag with a wildcard replacement and replaces the exisiting "no" value', function () { var oldTags = { amenity: 'shop' }, newTags = { shop: '*' }, - entity = iD.Entity({ tags: { amenity: 'shop', shop: 'no', name: 'Foo' }}), + entity = iD.osmEntity({ tags: { amenity: 'shop', shop: 'no', name: 'Foo' }}), graph = iD.actionUpgradeTags(entity.id, oldTags, newTags)(iD.coreGraph([entity])); expect(graph.entity(entity.id).tags).to.eql({ shop: 'yes', name: 'Foo' }); }); @@ -75,7 +75,7 @@ describe('iD.actionUpgradeTags', function () { it('upgrades a tag from a semicolon-delimited list that has one other value', function () { var oldTags = { cuisine: 'vegan' }, newTags = { 'diet:vegan': 'yes' }, - entity = iD.Entity({ tags: { cuisine: 'italian;vegan', name: 'Foo' }}), + entity = iD.osmEntity({ tags: { cuisine: 'italian;vegan', name: 'Foo' }}), graph = iD.actionUpgradeTags(entity.id, oldTags, newTags)(iD.coreGraph([entity])); expect(graph.entity(entity.id).tags).to.eql({ cuisine: 'italian', 'diet:vegan': 'yes', name: 'Foo' }); }); @@ -83,7 +83,7 @@ describe('iD.actionUpgradeTags', function () { it('upgrades a tag from a semicolon-delimited list that has many other values', function () { var oldTags = { cuisine: 'vegan' }, newTags = { 'diet:vegan': 'yes' }, - entity = iD.Entity({ tags: { cuisine: 'italian;vegan;regional;american', name: 'Foo' }}), + entity = iD.osmEntity({ tags: { cuisine: 'italian;vegan;regional;american', name: 'Foo' }}), graph = iD.actionUpgradeTags(entity.id, oldTags, newTags)(iD.coreGraph([entity])); expect(graph.entity(entity.id).tags).to.eql({ cuisine: 'italian;regional;american', 'diet:vegan': 'yes', name: 'Foo' }); }); @@ -91,7 +91,7 @@ describe('iD.actionUpgradeTags', function () { it('upgrades a tag within a semicolon-delimited list without changing other values', function () { var oldTags = { leisure: 'ice_rink', sport: 'hockey' }, newTags = { leisure: 'ice_rink', sport: 'ice_hockey' }, - entity = iD.Entity({ tags: { leisure: 'ice_rink', sport: 'curling;hockey;multi', name: 'Foo' }}), + entity = iD.osmEntity({ tags: { leisure: 'ice_rink', sport: 'curling;hockey;multi', name: 'Foo' }}), graph = iD.actionUpgradeTags(entity.id, oldTags, newTags)(iD.coreGraph([entity])); expect(graph.entity(entity.id).tags).to.eql({ leisure: 'ice_rink', sport: 'curling;ice_hockey;multi', name: 'Foo' }); }); diff --git a/test/spec/core/graph.js b/test/spec/core/graph.js index 1912ef371..84d3ed6a5 100644 --- a/test/spec/core/graph.js +++ b/test/spec/core/graph.js @@ -1,19 +1,19 @@ describe('iD.coreGraph', function() { describe('constructor', function () { it('accepts an entities Array', function () { - var entity = iD.Entity(), + var entity = iD.osmEntity(), graph = iD.coreGraph([entity]); expect(graph.entity(entity.id)).to.equal(entity); }); it('accepts a Graph', function () { - var entity = iD.Entity(), + var entity = iD.osmEntity(), graph = iD.coreGraph(iD.coreGraph([entity])); expect(graph.entity(entity.id)).to.equal(entity); }); it('copies other\'s entities', function () { - var entity = iD.Entity(), + var entity = iD.osmEntity(), base = iD.coreGraph([entity]), graph = iD.coreGraph(base); expect(graph.entities).not.to.equal(base.entities); diff --git a/test/spec/core/history.js b/test/spec/core/history.js index 517bed1c8..686108afa 100644 --- a/test/spec/core/history.js +++ b/test/spec/core/history.js @@ -452,7 +452,7 @@ describe('iD.coreHistory', function () { expect(history.graph().entity('n-1')).to.eql(iD.osmNode({id: 'n-1', loc: [1, 2]})); expect(history.undoAnnotation()).to.eql('Added a point.'); expect(history.imageryUsed()).to.eql(['Bing']); - expect(iD.Entity.id.next).to.eql({node: -2, way: -1, relation: -1}); + expect(iD.osmEntity.id.next).to.eql({node: -2, way: -1, relation: -1}); }); it('restores from v1 JSON (modification)', function() { @@ -469,7 +469,7 @@ describe('iD.coreHistory', function () { expect(history.graph().entity('n-1')).to.eql(iD.osmNode({id: 'n-1', loc: [2, 3], v: 1})); expect(history.undoAnnotation()).to.eql('Moved a point.'); expect(history.imageryUsed()).to.eql(['Bing']); - expect(iD.Entity.id.next).to.eql({node: -2, way: -1, relation: -1}); + expect(iD.osmEntity.id.next).to.eql({node: -2, way: -1, relation: -1}); }); it('restores from v1 JSON (deletion)', function() { @@ -486,7 +486,7 @@ describe('iD.coreHistory', function () { expect(history.graph().hasEntity('n1')).to.be.undefined; expect(history.undoAnnotation()).to.eql('Deleted a point.'); expect(history.imageryUsed()).to.eql(['Bing']); - expect(iD.Entity.id.next).to.eql({node: -1, way: -2, relation: -3}); + expect(iD.osmEntity.id.next).to.eql({node: -1, way: -2, relation: -3}); }); it('restores from v2 JSON (creation)', function() { @@ -506,7 +506,7 @@ describe('iD.coreHistory', function () { expect(history.graph().entity('n-1')).to.eql(iD.osmNode({id: 'n-1', loc: [1, 2]})); expect(history.undoAnnotation()).to.eql('Added a point.'); expect(history.imageryUsed()).to.eql(['Bing']); - expect(iD.Entity.id.next).to.eql({node: -2, way: -1, relation: -1}); + expect(iD.osmEntity.id.next).to.eql({node: -2, way: -1, relation: -1}); expect(history.difference().created().length).to.eql(1); }); @@ -528,7 +528,7 @@ describe('iD.coreHistory', function () { expect(history.graph().entity('n1')).to.eql(iD.osmNode({id: 'n1', loc: [2, 3], v: 1})); expect(history.undoAnnotation()).to.eql('Moved a point.'); expect(history.imageryUsed()).to.eql(['Bing']); - expect(iD.Entity.id.next).to.eql({node: -2, way: -1, relation: -1}); + expect(iD.osmEntity.id.next).to.eql({node: -2, way: -1, relation: -1}); expect(history.difference().modified().length).to.eql(1); }); @@ -548,7 +548,7 @@ describe('iD.coreHistory', function () { expect(history.graph().hasEntity('n1')).to.be.undefined; expect(history.undoAnnotation()).to.eql('Deleted a point.'); expect(history.imageryUsed()).to.eql(['Bing']); - expect(iD.Entity.id.next).to.eql({node: -1, way: -2, relation: -3}); + expect(iD.osmEntity.id.next).to.eql({node: -1, way: -2, relation: -3}); expect(history.difference().deleted().length).to.eql(1); }); @@ -570,7 +570,7 @@ describe('iD.coreHistory', function () { expect(history.graph().entity('n-1')).to.eql(iD.osmNode({id: 'n-1', loc: [1, 2]})); expect(history.undoAnnotation()).to.eql('Added a point.'); expect(history.imageryUsed()).to.eql(['Bing']); - expect(iD.Entity.id.next).to.eql({node: -2, way: -1, relation: -1}); + expect(iD.osmEntity.id.next).to.eql({node: -2, way: -1, relation: -1}); expect(history.difference().created().length).to.eql(1); }); @@ -592,7 +592,7 @@ describe('iD.coreHistory', function () { expect(history.graph().entity('n1')).to.eql(iD.osmNode({id: 'n1', loc: [2, 3], v: 1})); expect(history.undoAnnotation()).to.eql('Moved a point.'); expect(history.imageryUsed()).to.eql(['Bing']); - expect(iD.Entity.id.next).to.eql({node: -2, way: -1, relation: -1}); + expect(iD.osmEntity.id.next).to.eql({node: -2, way: -1, relation: -1}); expect(history.difference().modified().length).to.eql(1); }); @@ -612,7 +612,7 @@ describe('iD.coreHistory', function () { expect(history.graph().hasEntity('n1')).to.be.undefined; expect(history.undoAnnotation()).to.eql('Deleted a point.'); expect(history.imageryUsed()).to.eql(['Bing']); - expect(iD.Entity.id.next).to.eql({node: -1, way: -2, relation: -3}); + expect(iD.osmEntity.id.next).to.eql({node: -1, way: -2, relation: -3}); expect(history.difference().deleted().length).to.eql(1); }); }); diff --git a/test/spec/renderer/tile_layer.js b/test/spec/renderer/tile_layer.js index 0196ee11f..4dcbadb9c 100644 --- a/test/spec/renderer/tile_layer.js +++ b/test/spec/renderer/tile_layer.js @@ -1,10 +1,10 @@ -describe('iD.TileLayer', function() { +describe('iD.rendererTileLayer', function() { var context, d, c; beforeEach(function() { context = iD.coreContext().init(); d = d3.select(document.createElement('div')); - c = iD.TileLayer(context).projection(d3.geoMercator()); + c = iD.rendererTileLayer(context).projection(d3.geoMercator()); }); afterEach(function() {