mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-12 16:52:50 +00:00
Fix Entity#parentWays/Relations
This commit is contained in:
@@ -8,4 +8,20 @@ describe('Entity', function () {
|
||||
it('has no entity type', function () {
|
||||
expect(entity.entityType).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'}]);
|
||||
});
|
||||
});
|
||||
|
||||
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'}]);
|
||||
});
|
||||
})
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user