diff options
author | Roeland Jago Douma <rullzer@owncloud.com> | 2016-02-12 14:31:00 +0100 |
---|---|---|
committer | Roeland Jago Douma <rullzer@owncloud.com> | 2016-02-12 14:31:00 +0100 |
commit | 92c131b481b675907881af1b6a1d33f4191ee809 (patch) | |
tree | e5aeead68f273067516cd7b932bb48ef800557f1 /core/js | |
parent | 51b55d53206ec8731611e6a36bf8d7e3317a451a (diff) | |
download | nextcloud-server-92c131b481b675907881af1b6a1d33f4191ee809.tar.gz nextcloud-server-92c131b481b675907881af1b6a1d33f4191ee809.zip |
Updated unit tests
Diffstat (limited to 'core/js')
-rw-r--r-- | core/js/tests/specs/sharedialogviewSpec.js | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/core/js/tests/specs/sharedialogviewSpec.js b/core/js/tests/specs/sharedialogviewSpec.js index 6899e625c45..3a94379789a 100644 --- a/core/js/tests/specs/sharedialogviewSpec.js +++ b/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(); }); }); |