mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-13 01:02:58 +00:00
28 lines
882 B
JavaScript
28 lines
882 B
JavaScript
describe('Entity', function () {
|
|
var entity;
|
|
|
|
beforeEach(function () {
|
|
entity = new iD.Entity();
|
|
});
|
|
|
|
it('has no entity type', function () {
|
|
expect(entity.type).toEqual('');
|
|
});
|
|
|
|
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'}]);
|
|
});
|
|
});
|
|
});
|