summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2015-08-26 11:39:22 +0200
committerMorris Jobke <hey@morrisjobke.de>2015-08-26 11:39:22 +0200
commit202af1e3229278abde5dd4597917ff3c390d5f6f (patch)
treeb7dd337d7852715691aa1be079d9847f0d8e69ac
parentc11ea056d06be7859071eb3176462a9d4d56964e (diff)
downloadnextcloud-server-202af1e3229278abde5dd4597917ff3c390d5f6f.tar.gz
nextcloud-server-202af1e3229278abde5dd4597917ff3c390d5f6f.zip
fix unit tests
-rw-r--r--apps/files_sharing/tests/js/shareSpec.js16
-rw-r--r--core/js/tests/specs/shareSpec.js4
2 files changed, 10 insertions, 10 deletions
diff --git a/apps/files_sharing/tests/js/shareSpec.js b/apps/files_sharing/tests/js/shareSpec.js
index 581e15caf93..b6368b901ee 100644
--- a/apps/files_sharing/tests/js/shareSpec.js
+++ b/apps/files_sharing/tests/js/shareSpec.js
@@ -117,7 +117,7 @@ describe('OCA.Sharing.Util tests', function() {
$tr = fileList.$el.find('tbody tr:first');
$action = $tr.find('.action-share');
expect($action.hasClass('permanent')).toEqual(true);
- expect($action.find('>span').text()).toEqual('Shared');
+ expect($action.find('>span').text().trim()).toEqual('Shared');
expect(OC.basename($action.find('img').attr('src'))).toEqual('share.svg');
expect(OC.basename(getImageUrl($tr.find('.filename .thumbnail')))).toEqual('folder-shared.svg');
expect($action.find('img').length).toEqual(1);
@@ -138,7 +138,7 @@ describe('OCA.Sharing.Util tests', function() {
$tr = fileList.$el.find('tbody tr:first');
$action = $tr.find('.action-share');
expect($action.hasClass('permanent')).toEqual(true);
- expect($action.find('>span').text()).toEqual('Shared');
+ expect($action.find('>span').text().trim()).toEqual('Shared');
expect(OC.basename($action.find('img').attr('src'))).toEqual('public.svg');
expect(OC.basename(getImageUrl($tr.find('.filename .thumbnail')))).toEqual('folder-public.svg');
expect($action.find('img').length).toEqual(1);
@@ -159,7 +159,7 @@ describe('OCA.Sharing.Util tests', function() {
$tr = fileList.$el.find('tbody tr:first');
$action = $tr.find('.action-share');
expect($action.hasClass('permanent')).toEqual(true);
- expect($action.find('>span').text()).toEqual('User One');
+ expect($action.find('>span').text().trim()).toEqual('User One');
expect(OC.basename($action.find('img').attr('src'))).toEqual('share.svg');
expect(OC.basename(getImageUrl($tr.find('.filename .thumbnail')))).toEqual('folder-shared.svg');
});
@@ -179,7 +179,7 @@ describe('OCA.Sharing.Util tests', function() {
$tr = fileList.$el.find('tbody tr:first');
$action = $tr.find('.action-share');
expect($action.hasClass('permanent')).toEqual(true);
- expect($action.find('>span').text()).toEqual('Shared with User One, User Two');
+ expect($action.find('>span').text().trim()).toEqual('Shared with User One, User Two');
expect(OC.basename($action.find('img').attr('src'))).toEqual('share.svg');
expect(OC.basename(getImageUrl($tr.find('.filename .thumbnail')))).toEqual('folder-shared.svg');
expect($action.find('img').length).toEqual(1);
@@ -275,7 +275,7 @@ describe('OCA.Sharing.Util tests', function() {
OC.Share.updateIcon('file', 1);
expect($action.hasClass('permanent')).toEqual(true);
- expect($action.find('>span').text()).toEqual('Shared with Group One, Group Two, User One, User Two');
+ expect($action.find('>span').text().trim()).toEqual('Shared with Group One, Group Two, User One, User Two');
expect(OC.basename($action.find('img').attr('src'))).toEqual('share.svg');
});
it('updates share icon after updating shares of a file', function() {
@@ -311,7 +311,7 @@ describe('OCA.Sharing.Util tests', function() {
OC.Share.updateIcon('file', 1);
expect($action.hasClass('permanent')).toEqual(true);
- expect($action.find('>span').text()).toEqual('Shared with User One, User Three, User Two');
+ expect($action.find('>span').text().trim()).toEqual('Shared with User One, User Three, User Two');
expect(OC.basename($action.find('img').attr('src'))).toEqual('share.svg');
});
it('removes share icon after removing all shares from a file', function() {
@@ -380,7 +380,7 @@ describe('OCA.Sharing.Util tests', function() {
OC.Share.updateIcon('file', 1);
expect($action.hasClass('permanent')).toEqual(true);
- expect($action.find('>span').text()).toEqual('User One');
+ expect($action.find('>span').text().trim()).toEqual('User One');
expect(OC.basename($action.find('img').attr('src'))).toEqual('share.svg');
});
it('keep share text after unsharing reshare', function() {
@@ -416,7 +416,7 @@ describe('OCA.Sharing.Util tests', function() {
OC.Share.updateIcon('file', 1);
expect($action.hasClass('permanent')).toEqual(true);
- expect($action.find('>span').text()).toEqual('User One');
+ expect($action.find('>span').text().trim()).toEqual('User One');
expect(OC.basename($action.find('img').attr('src'))).toEqual('share.svg');
});
});
diff --git a/core/js/tests/specs/shareSpec.js b/core/js/tests/specs/shareSpec.js
index 3dc25134f59..5a59a117d77 100644
--- a/core/js/tests/specs/shareSpec.js
+++ b/core/js/tests/specs/shareSpec.js
@@ -1132,7 +1132,7 @@ describe('OC.Share tests', function() {
OC.Share.markFileAsShared($file);
$action = $file.find('.action-share>span');
- expect($action.text()).toEqual(output);
+ expect($action.text().trim()).toEqual(output);
if (_.isString(title)) {
expect($action.find('.remoteAddress').attr('title')).toEqual(title);
} else {
@@ -1236,7 +1236,7 @@ describe('OC.Share tests', function() {
OC.Share.markFileAsShared($file, true);
$action = $file.find('.action-share>span');
- expect($action.text()).toEqual(output);
+ expect($action.text().trim()).toEqual(output);
if (_.isString(title)) {
expect($action.find('.remoteAddress').attr('title')).toEqual(title);
} else if (_.isArray(title)) {