Files
iD/test/spec/Entity.js
2012-10-31 21:07:29 -04:00

24 lines
789 B
JavaScript

describe('Entity', function () {
var entity;
beforeEach(function () {
entity = new iD.Entity();
});
describe('#parentWays', function () {
it('returns an array of parents with entityType way', function () {
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, type: 'way'});
entity.addParent({_id: 2, type: 'relation'});
expect(entity.parentRelations()).toEqual([{_id: 2, type: 'relation'}]);
});
});
});