mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-28 10:51:45 +02:00
Upgrade legacy symbols in tests
- iD.Context -> iD.coreContext - iD.Graph -> iD.coreGraph - iD.Node -> iD.osmNode - iD.Way -> iD.osmWay - iD.Relation -> iD.osmRelation
This commit is contained in:
+23
-23
@@ -2,10 +2,10 @@ describe('iD.util', function() {
|
||||
|
||||
describe('utilGetAllNodes', function() {
|
||||
it('gets all descendant nodes of a way', function() {
|
||||
var a = iD.Node({ id: 'a' }),
|
||||
b = iD.Node({ id: 'b' }),
|
||||
w = iD.Way({ id: 'w', nodes: ['a','b','a'] }),
|
||||
graph = iD.Graph([a, b, w]),
|
||||
var a = iD.osmNode({ id: 'a' }),
|
||||
b = iD.osmNode({ id: 'b' }),
|
||||
w = iD.osmWay({ id: 'w', nodes: ['a','b','a'] }),
|
||||
graph = iD.coreGraph([a, b, w]),
|
||||
result = iD.utilGetAllNodes(['w'], graph);
|
||||
|
||||
expect(result).to.have.members([a, b]);
|
||||
@@ -13,12 +13,12 @@ describe('iD.util', function() {
|
||||
});
|
||||
|
||||
it('gets all descendant nodes of a relation', function() {
|
||||
var a = iD.Node({ id: 'a' }),
|
||||
b = iD.Node({ id: 'b' }),
|
||||
c = iD.Node({ id: 'c' }),
|
||||
w = iD.Way({ id: 'w', nodes: ['a','b','a'] }),
|
||||
r = iD.Relation({ id: 'r', members: [{id: 'w'}, {id: 'c'}] }),
|
||||
graph = iD.Graph([a, b, c, w, r]),
|
||||
var a = iD.osmNode({ id: 'a' }),
|
||||
b = iD.osmNode({ id: 'b' }),
|
||||
c = iD.osmNode({ id: 'c' }),
|
||||
w = iD.osmWay({ id: 'w', nodes: ['a','b','a'] }),
|
||||
r = iD.osmRelation({ id: 'r', members: [{id: 'w'}, {id: 'c'}] }),
|
||||
graph = iD.coreGraph([a, b, c, w, r]),
|
||||
result = iD.utilGetAllNodes(['r'], graph);
|
||||
|
||||
expect(result).to.have.members([a, b, c]);
|
||||
@@ -26,15 +26,15 @@ describe('iD.util', function() {
|
||||
});
|
||||
|
||||
it('gets all descendant nodes of multiple ids', function() {
|
||||
var a = iD.Node({ id: 'a' }),
|
||||
b = iD.Node({ id: 'b' }),
|
||||
c = iD.Node({ id: 'c' }),
|
||||
d = iD.Node({ id: 'd' }),
|
||||
e = iD.Node({ id: 'e' }),
|
||||
w1 = iD.Way({ id: 'w1', nodes: ['a','b','a'] }),
|
||||
w2 = iD.Way({ id: 'w2', nodes: ['c','b','a','c'] }),
|
||||
r = iD.Relation({ id: 'r', members: [{id: 'w1'}, {id: 'd'}] }),
|
||||
graph = iD.Graph([a, b, c, d, e, w1, w2, r]),
|
||||
var a = iD.osmNode({ id: 'a' }),
|
||||
b = iD.osmNode({ id: 'b' }),
|
||||
c = iD.osmNode({ id: 'c' }),
|
||||
d = iD.osmNode({ id: 'd' }),
|
||||
e = iD.osmNode({ id: 'e' }),
|
||||
w1 = iD.osmWay({ id: 'w1', nodes: ['a','b','a'] }),
|
||||
w2 = iD.osmWay({ id: 'w2', nodes: ['c','b','a','c'] }),
|
||||
r = iD.osmRelation({ id: 'r', members: [{id: 'w1'}, {id: 'd'}] }),
|
||||
graph = iD.coreGraph([a, b, c, d, e, w1, w2, r]),
|
||||
result = iD.utilGetAllNodes(['r', 'w2', 'e'], graph);
|
||||
|
||||
expect(result).to.have.members([a, b, c, d, e]);
|
||||
@@ -42,10 +42,10 @@ describe('iD.util', function() {
|
||||
});
|
||||
|
||||
it('handles recursive relations', function() {
|
||||
var a = iD.Node({ id: 'a' }),
|
||||
r1 = iD.Relation({ id: 'r1', members: [{id: 'r2'}] }),
|
||||
r2 = iD.Relation({ id: 'r2', members: [{id: 'r1'}, {id: 'a'}] }),
|
||||
graph = iD.Graph([a, r1, r2]),
|
||||
var a = iD.osmNode({ id: 'a' }),
|
||||
r1 = iD.osmRelation({ id: 'r1', members: [{id: 'r2'}] }),
|
||||
r2 = iD.osmRelation({ id: 'r2', members: [{id: 'r1'}, {id: 'a'}] }),
|
||||
graph = iD.coreGraph([a, r1, r2]),
|
||||
result = iD.utilGetAllNodes(['r1'], graph);
|
||||
|
||||
expect(result).to.have.members([a]);
|
||||
|
||||
Reference in New Issue
Block a user