diff options
author | Morris Jobke <hey@morrisjobke.de> | 2016-07-07 09:54:32 +0200 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2016-07-07 15:10:04 +0200 |
commit | beae00a5e5457c41994e54c7f0563245d9ccf5ce (patch) | |
tree | 98eb2b40b0268a63403e88901cddba98ac510734 /apps/files_sharing | |
parent | 43b26b9506bd5fd4b46713d83980041c63d7b06d (diff) | |
download | nextcloud-server-beae00a5e5457c41994e54c7f0563245d9ccf5ce.tar.gz nextcloud-server-beae00a5e5457c41994e54c7f0563245d9ccf5ce.zip |
Simplify test code and don't show anything if no date is set
Diffstat (limited to 'apps/files_sharing')
-rw-r--r-- | apps/files_sharing/js/sharedfilelist.js | 2 | ||||
-rw-r--r-- | apps/files_sharing/tests/js/sharedfilelistSpec.js | 12 |
2 files changed, 4 insertions, 10 deletions
diff --git a/apps/files_sharing/js/sharedfilelist.js b/apps/files_sharing/js/sharedfilelist.js index ca87acd6ceb..dccd6027b02 100644 --- a/apps/files_sharing/js/sharedfilelist.js +++ b/apps/files_sharing/js/sharedfilelist.js @@ -101,7 +101,7 @@ text = OC.Util.relativeModifiedDate(expirationTimestamp); } else { formatted = t('files_sharing', 'No expiration date set'); - text = t('files_sharing', 'Never'); + text = ''; modifiedColor = 160; } td = $('<td></td>').attr({"class": "date"}); diff --git a/apps/files_sharing/tests/js/sharedfilelistSpec.js b/apps/files_sharing/tests/js/sharedfilelistSpec.js index a4448a1c0e2..f177b61c78a 100644 --- a/apps/files_sharing/tests/js/sharedfilelistSpec.js +++ b/apps/files_sharing/tests/js/sharedfilelistSpec.js @@ -515,14 +515,8 @@ describe('OCA.Sharing.FileList tests', function() { fileList.reload(); - var currentdate = new Date(); - var expirationDateInADay = - + currentdate.getFullYear() + "-" - + ((currentdate.getMonth()+1 < 10) ? "0" : "") + (currentdate.getMonth()+1) + "-" - + ((currentdate.getDate()+1 < 10) ? "0" : "") + (currentdate.getDate()+1) + " " - + ((currentdate.getHours()+1 < 10) ? "0" : "") + currentdate.getHours() + ":" - + ((currentdate.getMinutes()+1 < 10) ? "0" : "") + currentdate.getMinutes() + ":" - + ((currentdate.getSeconds()+1 < 10) ? "0" : "") + currentdate.getSeconds(); + var expirationDateInADay = moment() + .add(1, 'days').format('YYYY-MM-DD HH:mm:ss'); /* jshint camelcase: false */ ocsResponse = { @@ -617,7 +611,7 @@ describe('OCA.Sharing.FileList tests', function() { OC.webroot + '/remote.php/webdav/local%20path/local%20name.txt' ); expect($tr.attr('data-expiration')).toEqual('0'); - expect($tr.find('td:last-child span').text()).toEqual('Never'); + expect($tr.find('td:last-child span').text()).toEqual(''); expect($tr.find('.nametext').text().trim()).toEqual('local name.txt'); |