diff options
author | Morris Jobke <hey@morrisjobke.de> | 2018-07-13 17:29:57 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-13 17:29:57 +0200 |
commit | 82021b2b1bd6e6ae9c85564ba614797a1110e29c (patch) | |
tree | dcae47bf607411ae0e2e4e54ed5715aa98354c35 /core/js/tests/specs | |
parent | 14314584ba88ed8d8a7c8486b61c6677a14271f2 (diff) | |
parent | 4f5814c27bc43a8f10bd35f60bc3254697c50659 (diff) | |
download | nextcloud-server-82021b2b1bd6e6ae9c85564ba614797a1110e29c.tar.gz nextcloud-server-82021b2b1bd6e6ae9c85564ba614797a1110e29c.zip |
Merge pull request #5280 from nextcloud/shared-with-display-name
sharedWithDisplayName & sharedWithAvatar
Diffstat (limited to 'core/js/tests/specs')
-rw-r--r-- | core/js/tests/specs/sharedialogviewSpec.js | 36 |
1 files changed, 32 insertions, 4 deletions
diff --git a/core/js/tests/specs/sharedialogviewSpec.js b/core/js/tests/specs/sharedialogviewSpec.js index 83c89053202..5fd920a758c 100644 --- a/core/js/tests/specs/sharedialogviewSpec.js +++ b/core/js/tests/specs/sharedialogviewSpec.js @@ -427,7 +427,21 @@ describe('OC.Share.ShareDialogView', function() { share_type: OC.Share.SHARE_TYPE_REMOTE, share_with: 'foo@bar.com/baz', share_with_displayname: 'foo@bar.com/baz' - + },{ + id: 103, + item_source: 123, + permissions: 31, + share_type: OC.Share.SHARE_TYPE_CIRCLE, + share_with: 'circle-0', + share_with_displayname: 'Circle (Personal circle, user0)', + share_with_avatar: 'path/to/the/avatar' + },{ + id: 104, + item_source: 123, + permissions: 31, + share_type: OC.Share.SHARE_TYPE_CIRCLE, + share_with: 'circle-1', + share_with_displayname: 'Circle (Public circle, user0)', }] }); }); @@ -439,10 +453,10 @@ describe('OC.Share.ShareDialogView', function() { }); it('test correct function calls', function() { - expect(avatarStub.calledTwice).toEqual(true); + expect(avatarStub.calledThrice).toEqual(true); expect(placeholderStub.callCount).toEqual(4); - expect(dialog.$('.shareWithList').children().length).toEqual(3); - expect(dialog.$('.avatar').length).toEqual(4); + expect(dialog.$('.shareWithList').children().length).toEqual(5); + expect(dialog.$('.avatar').length).toEqual(6); }); it('test avatar owner', function() { @@ -469,6 +483,20 @@ describe('OC.Share.ShareDialogView', function() { expect(args.length).toEqual(1); expect(args[0]).toEqual('foo@bar.com/baz ' + OC.Share.SHARE_TYPE_REMOTE); }); + + it('test avatar for circle', function() { + var avatarElement = dialog.$('.avatar').eq(4); + expect(avatarElement.css('background')).toContain('path/to/the/avatar'); + }); + + it('test avatar for circle without avatar', function() { + var args = avatarStub.getCall(2).args; + expect(args.length).toEqual(6); + // Note that "data-username" is set to "circle-{shareIndex}", + // not to the "shareWith" field. + expect(args[0]).toEqual('circle-4'); + expect(args[5]).toEqual('Circle (Public circle, user0)'); + }); }); }); describe('get suggestions', function() { |