Fix Entity#parentWays/Relations

This commit is contained in:
John Firebaugh
2012-10-26 13:25:36 -07:00
parent 260b548ff3
commit 1f6be2d2ba
2 changed files with 18 additions and 2 deletions

View File

@@ -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'}]);
});
})
});