Updated unit tests

remotes/origin/users-ajaxloadgroups
Roeland Jago Douma 9 years ago
parent 51b55d5320
commit 92c131b481
  1. 16
      core/js/tests/specs/sharedialogviewSpec.js

@ -956,9 +956,12 @@ describe('OC.Share.ShareDialogView', function() {
it('calls addShare after selection', function() {
dialog.render();
var shareWith = $('.shareWithField')[0];
var $shareWith = $(shareWith);
var addShareStub = sinon.stub(shareModel, 'addShare');
var autocompleteOptions = autocompleteStub.getCall(0).args[0];
autocompleteOptions.select(new $.Event('select'), {
autocompleteOptions.select(new $.Event('select', {target: shareWith}), {
item: {
label: 'User Two',
value: {
@ -974,6 +977,17 @@ describe('OC.Share.ShareDialogView', function() {
shareWith: 'user2'
});
//Input is locked
expect($shareWith.val()).toEqual('User Two');
expect($shareWith.attr('disabled')).toEqual('disabled');
//Callback is called
addShareStub.firstCall.args[1].success();
//Input is unlocked
expect($shareWith.val()).toEqual('');
expect($shareWith.attr('disabled')).toEqual(undefined);
addShareStub.restore();
});
});

Loading…
Cancel
Save