summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/tests/js/shareSpec.js
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@arthur-schiwon.de>2017-11-21 12:45:57 +0100
committerArthur Schiwon <blizzz@arthur-schiwon.de>2017-11-23 13:32:14 +0100
commit077381c7b3aa220253a18ce3bbb946e4a46d8213 (patch)
tree8a4ca1104135a465b63f5a50738f9e225fa3fbfa /apps/files_sharing/tests/js/shareSpec.js
parent9d95391ff14a1c753e8fda4ecaacc007572552f4 (diff)
downloadnextcloud-server-077381c7b3aa220253a18ce3bbb946e4a46d8213.tar.gz
nextcloud-server-077381c7b3aa220253a18ce3bbb946e4a46d8213.zip
rip out obsolete recipientsDisplayName
also needs tests adjustements, and this also brings in natural sorting Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Diffstat (limited to 'apps/files_sharing/tests/js/shareSpec.js')
-rw-r--r--apps/files_sharing/tests/js/shareSpec.js57
1 files changed, 2 insertions, 55 deletions
diff --git a/apps/files_sharing/tests/js/shareSpec.js b/apps/files_sharing/tests/js/shareSpec.js
index 1b628f5bb0f..893525f7566 100644
--- a/apps/files_sharing/tests/js/shareSpec.js
+++ b/apps/files_sharing/tests/js/shareSpec.js
@@ -282,8 +282,6 @@ describe('OCA.Sharing.Util tests', function() {
]
});
- expect($tr.attr('data-share-recipients')).toEqual('Group One, Group Two, User One, User Two');
-
expect($action.text().trim()).toEqual('Shared with Group One Shared with Group Two Shared with User One Shared with User Two');
expect($action.find('.icon').hasClass('icon-shared')).toEqual(true);
expect($action.find('.icon').hasClass('icon-public')).toEqual(false);
@@ -315,8 +313,6 @@ describe('OCA.Sharing.Util tests', function() {
]
});
- expect($tr.attr('data-share-recipients')).toEqual('User One, User Three, User Two');
-
expect($action.text().trim()).toEqual('Shared with User One Shared with User Three Shared with User Two');
expect($action.find('.icon').hasClass('icon-shared')).toEqual(true);
expect($action.find('.icon').hasClass('icon-public')).toEqual(false);
@@ -345,7 +341,7 @@ describe('OCA.Sharing.Util tests', function() {
shares: []
});
- expect($tr.attr('data-share-recipients')).not.toBeDefined();
+ expect($tr.attr('data-share-recipient-data')).not.toBeDefined();
});
it('keep share text after updating reshare', function() {
var $action, $tr;
@@ -372,8 +368,6 @@ describe('OCA.Sharing.Util tests', function() {
shares: [{share_with_displayname: 'User Two'}]
});
- expect($tr.attr('data-share-recipients')).toEqual('User Two');
-
expect($action.find('>span').text().trim()).toEqual('Shared by User One');
expect($action.find('.icon').hasClass('icon-shared')).toEqual(true);
expect($action.find('.icon').hasClass('icon-public')).toEqual(false);
@@ -405,60 +399,13 @@ describe('OCA.Sharing.Util tests', function() {
shares: []
});
- expect($tr.attr('data-share-recipients')).not.toBeDefined();
+ expect($tr.attr('data-share-recipient-data')).not.toBeDefined();
expect($action.find('>span').text().trim()).toEqual('Shared by User One');
expect($action.find('.icon').hasClass('icon-shared')).toEqual(true);
expect($action.find('.icon').hasClass('icon-public')).toEqual(false);
});
});
- describe('formatRecipients', function() {
- it('returns a single recipient when one passed', function() {
- expect(OCA.Sharing.Util.formatRecipients(['User one']))
- .toEqual('User one');
- });
- it('returns two recipients when two passed', function() {
- expect(OCA.Sharing.Util.formatRecipients(['User one', 'User two']))
- .toEqual('User one, User two');
- });
- it('returns four recipients with plus when five passed', function() {
- var recipients = [
- 'User one',
- 'User two',
- 'User three',
- 'User four',
- 'User five'
- ];
- expect(OCA.Sharing.Util.formatRecipients(recipients))
- .toEqual('User four, User one, User three, User two, +1');
- });
- it('returns four recipients with plus when ten passed', function() {
- var recipients = [
- 'User one',
- 'User two',
- 'User three',
- 'User four',
- 'User five',
- 'User six',
- 'User seven',
- 'User eight',
- 'User nine',
- 'User ten'
- ];
- expect(OCA.Sharing.Util.formatRecipients(recipients))
- .toEqual('User four, User one, User three, User two, +6');
- });
- it('returns four recipients with plus when four passed with counter', function() {
- var recipients = [
- 'User one',
- 'User two',
- 'User three',
- 'User four'
- ];
- expect(OCA.Sharing.Util.formatRecipients(recipients, 10))
- .toEqual('User four, User one, User three, User two, +6');
- });
- });
describe('Excluded lists', function() {
function createListThenAttach(listId) {
var fileActions = new OCA.Files.FileActions();