summaryrefslogtreecommitdiffstats
path: root/core/js/tests
diff options
context:
space:
mode:
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 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() {