Updated unit tests
This commit is contained in:
parent
51b55d5320
commit
92c131b481
|
@ -956,9 +956,12 @@ describe('OC.Share.ShareDialogView', function() {
|
||||||
|
|
||||||
it('calls addShare after selection', function() {
|
it('calls addShare after selection', function() {
|
||||||
dialog.render();
|
dialog.render();
|
||||||
|
|
||||||
|
var shareWith = $('.shareWithField')[0];
|
||||||
|
var $shareWith = $(shareWith);
|
||||||
var addShareStub = sinon.stub(shareModel, 'addShare');
|
var addShareStub = sinon.stub(shareModel, 'addShare');
|
||||||
var autocompleteOptions = autocompleteStub.getCall(0).args[0];
|
var autocompleteOptions = autocompleteStub.getCall(0).args[0];
|
||||||
autocompleteOptions.select(new $.Event('select'), {
|
autocompleteOptions.select(new $.Event('select', {target: shareWith}), {
|
||||||
item: {
|
item: {
|
||||||
label: 'User Two',
|
label: 'User Two',
|
||||||
value: {
|
value: {
|
||||||
|
@ -974,6 +977,17 @@ describe('OC.Share.ShareDialogView', function() {
|
||||||
shareWith: 'user2'
|
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();
|
addShareStub.restore();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue