mirror of
https://github.com/FoggedLens/iD.git
synced 2026-06-02 21:21:37 +02:00
Rename "visible" property of presets to "addable" (re: a06ec59514b30a52601e3614ef69006d2dc1bc91)
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user