mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-13 09:12:52 +00:00
24 lines
789 B
JavaScript
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'}]);
|
|
});
|
|
});
|
|
});
|