Files
iD/test/spec/presets/category.js
Bryan Housel f95e7db8c9 Create the categories like the presets
The lack of locationSet was causing them to not show up, which indirectly
broke the tutorial at the step where user needs to pick the road category.
2021-03-12 12:04:52 -05:00

28 lines
902 B
JavaScript

describe('iD.presetCategory', function() {
var category = {
'geometry': 'line',
'icon': 'highway',
'name': 'roads',
'members': [ 'highway/residential' ]
};
var residential = iD.presetPreset('highway/residential',
{ tags: { highway: 'residential' }, geometry: ['line'] }
);
var allPresets = { 'highway/residential': residential };
it('maps members names to preset instances', function() {
var c = iD.presetCategory('road', category, allPresets);
expect(c.members.collection[0]).to.eql(residential);
});
describe('#matchGeometry', function() {
it('matches the type of an entity', function() {
var c = iD.presetCategory('road', category, allPresets);
expect(c.matchGeometry('line')).to.eql(true);
expect(c.matchGeometry('point')).to.eql(false);
});
});
});