mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-24 00:54:03 +02:00
Move graph out of connection, move more logic to Util, update tests.
This commit is contained in:
+7
-7
@@ -6,22 +6,22 @@ describe('Entity', function () {
|
||||
});
|
||||
|
||||
it('has no entity type', function () {
|
||||
expect(entity.entityType).toEqual('');
|
||||
expect(entity.type).toEqual('');
|
||||
});
|
||||
|
||||
describe('#parentWays', function () {
|
||||
it('returns an array of parents with entityType way', function () {
|
||||
entity.addParent({_id: 1, entityType: 'way'});
|
||||
entity.addParent({_id: 2, entityType: 'node'});
|
||||
expect(entity.parentWays()).toEqual([{_id: 1, entityType: 'way'}]);
|
||||
entity.addParent({_id: 1, type: 'way'});
|
||||
entity.addParent({_id: 2, type: 'node'});
|
||||
expect(entity.parentWays()).toEqual([{_id: 1, type: 'way'}]);
|
||||
});
|
||||
});
|
||||
|
||||
describe('#parentRelations', function () {
|
||||
it('returns an array of parents with entityType relation', function () {
|
||||
entity.addParent({_id: 1, entityType: 'way'});
|
||||
entity.addParent({_id: 2, entityType: 'relation'});
|
||||
expect(entity.parentRelations()).toEqual([{_id: 2, entityType: 'relation'}]);
|
||||
entity.addParent({_id: 1, type: 'way'});
|
||||
entity.addParent({_id: 2, type: 'relation'});
|
||||
expect(entity.parentRelations()).toEqual([{_id: 2, type: 'relation'}]);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user