summaryrefslogtreecommitdiffstats
path: root/core/js/tests
diff options
context:
space:
mode:
authorMaxence Lange <maxence@nextcloud.com>2017-06-06 10:21:42 -0100
committerDaniel Calviño Sánchez <danxuliu@gmail.com>2018-05-21 01:24:45 +0200
commit0009adae80cf9b3f8bcc40bd3f75d2a3f2cee6ad (patch)
tree22a62264854300ff73a62bcf94262d5fcad86adf /core/js/tests
parentca089b9412af79cc696342968a657991755a2e2e (diff)
downloadnextcloud-server-0009adae80cf9b3f8bcc40bd3f75d2a3f2cee6ad.tar.gz
nextcloud-server-0009adae80cf9b3f8bcc40bd3f75d2a3f2cee6ad.zip
SharedWithDisplayName + SharedWithAvatar
Signed-off-by: Maxence Lange <maxence@nextcloud.com> Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'core/js/tests')
-rw-r--r--core/js/tests/specs/sharedialogviewSpec.js36
1 files changed, 32 insertions, 4 deletions
diff --git a/core/js/tests/specs/sharedialogviewSpec.js b/core/js/tests/specs/sharedialogviewSpec.js
index d3639159849..265bfbca973 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() {