Rename "visible" property of presets to "addable" (re: a06ec59514b30a52601e3614ef69006d2dc1bc91)

This commit is contained in:
Quincy Morgan
2020-01-15 14:29:45 -05:00
parent f270c475ea
commit 41355bf2a0
5 changed files with 29 additions and 26 deletions
+4 -4
View File
@@ -162,7 +162,7 @@ describe('iD.presetIndex', function () {
presets.build(morePresets, false);
entities.forEach(function (entity) {
var preset = presets.match(entity, graph);
expect(preset.visible()).to.be.false;
expect(preset.addable()).to.be.false;
});
});
});
@@ -252,7 +252,7 @@ describe('iD.presetIndex', function () {
server.restore();
});
it('builds presets w/external sources set to visible', function () {
it('builds presets w/external sources set to addable', function () {
var surfShop = iD.osmNode({ tags: { amenity: 'shop', 'shop:type': 'surf' } });
var graph = iD.coreGraph([surfShop]);
var url = 'https://fakemaprules.io/fake.json';
@@ -274,12 +274,12 @@ describe('iD.presetIndex', function () {
server.respond();
});
it('makes only the external presets initially visible', function () {
it('makes only the external presets initially addable', function () {
var url = 'https://fakemaprules.io/fake.json';
iD.coreContext().presets().fromExternal(url, function(externalPresets) {
var external = externalPresets.collection.reduce(function(presets, preset) {
if (!preset.hasOwnProperty('members') && preset.visible()) {
if (!preset.hasOwnProperty('members') && preset.addable()) {
presets.push(preset.id);
}
return presets;
+4 -4
View File
@@ -194,12 +194,12 @@ describe('iD.presetPreset', function() {
});
});
describe('#visible', function() {
describe('#addable', function() {
it('sets/gets visibility of preset', function() {
var preset = iD.presetPreset('test', {}, false);
expect(preset.visible()).to.be.false;
preset.visible(true);
expect(preset.visible()).to.be.true;
expect(preset.addable()).to.be.false;
preset.addable(true);
expect(preset.addable()).to.be.true;
});
});
});