diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2016-02-15 10:45:42 +0100 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2016-02-15 10:45:42 +0100 |
commit | 2054dbd4c886e8f4d3fcd02f95bab78fb88cc917 (patch) | |
tree | baa458851c593dcf06c346a59a281169ac74945c /core/js/tests | |
parent | be34cea970b9953ba70ddcec296ad48cd36df797 (diff) | |
parent | 92c131b481b675907881af1b6a1d33f4191ee809 (diff) | |
download | nextcloud-server-2054dbd4c886e8f4d3fcd02f95bab78fb88cc917.tar.gz nextcloud-server-2054dbd4c886e8f4d3fcd02f95bab78fb88cc917.zip |
Merge pull request #22350 from owncloud/fix_22304
WebUI feedback when sharing
Diffstat (limited to 'core/js/tests')
-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(); }); }); |