Test .removeFolder().

This commit is contained in:
Don McCurdy 2017-12-23 11:59:44 -05:00
parent 76c80858c3
commit 59f685b018
2 changed files with 36 additions and 22 deletions

View File

@ -640,9 +640,9 @@ common.extend(
// Do we have saved appearance data for this folder? // Do we have saved appearance data for this folder?
if (this.load && // Anything loaded? if (this.load && // Anything loaded?
this.load.folders && // Was my parent a dead-end? this.load.folders && // Was my parent a dead-end?
this.load.folders[folder.name]) { this.load.folders[folder.name]) {
delete this.load.folders[folder.name]; delete this.load.folders[folder.name];
} }
const _this = this; const _this = this;

View File

@ -1187,6 +1187,20 @@ console.log(c2.__checkbox.getAttribute('checked'));
}); });
test('removeFolder', function() {
var gui = new GUI();
var f = gui.addFolder('Temporary folder');
ok($.contains(gui.domElement, f.domElement), "Now you see it");
gui.removeFolder(f);
ok(!$.contains(gui.domElement, f.domElement), "Now you don't.");
gui.destroy();
});
test('min, max & step', function() { test('min, max & step', function() {