add unit test

This commit is contained in:
Robin Appelman 2015-04-02 18:31:26 +02:00
parent 10b85871cc
commit 519d568847
2 changed files with 13 additions and 0 deletions

View File

@ -509,6 +509,8 @@ MountOptionsDropdown.prototype = {
var optionId = $row.find('input, select').attr('name');
if (enabledOptions.indexOf(optionId) === -1) {
$row.hide();
} else {
$row.show();
}
});
}

View File

@ -205,6 +205,17 @@ describe('OCA.External.Settings tests', function() {
expect($td.find('.dropdown').length).toEqual(0);
});
it('doesnt show the encryption option when encryption is disabled', function () {
view._encryptionEnabled = false;
$td.find('img').click();
expect($td.find('.dropdown [name=encrypt]:visible').length).toEqual(0);
$('body').mouseup();
expect($td.find('.dropdown').length).toEqual(0);
});
it('reads config from mountOptions field', function() {
$tr.find('input.mountOptions').val(JSON.stringify({previews:false}));