summaryrefslogtreecommitdiffstats
path: root/apps/files/tests
diff options
context:
space:
mode:
authorRobin McCorkell <rmccorkell@karoshi.org.uk>2014-12-05 13:54:43 +0000
committerRobin McCorkell <rmccorkell@karoshi.org.uk>2014-12-12 23:54:18 +0000
commitfdbb68a3c3aa6c6cf6ae5c440dd7b742076f1184 (patch)
tree986e057cc0bde8a8cd2dbbfe1e382ea72f3b9801 /apps/files/tests
parent5f66cb32502c88d7182c3dc5994ef733762fa665 (diff)
downloadnextcloud-server-fdbb68a3c3aa6c6cf6ae5c440dd7b742076f1184.tar.gz
nextcloud-server-fdbb68a3c3aa6c6cf6ae5c440dd7b742076f1184.zip
Return ? if mtime is 0 or -1
Tooltip contains 'Unable to determine date'. Fixes #6395
Diffstat (limited to 'apps/files/tests')
-rw-r--r--apps/files/tests/js/filelistSpec.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/apps/files/tests/js/filelistSpec.js b/apps/files/tests/js/filelistSpec.js
index 21f8a12f4b5..d7a1433485d 100644
--- a/apps/files/tests/js/filelistSpec.js
+++ b/apps/files/tests/js/filelistSpec.js
@@ -183,6 +183,7 @@ describe('OCA.Files.FileList tests', function() {
expect($tr.find('.nametext').text().trim()).toEqual('testName.txt');
expect($tr.find('.filesize').text()).toEqual('1 kB');
+ expect($tr.find('.date').text()).not.toEqual('?');
expect(fileList.findFileEl('testName.txt')[0]).toEqual($tr[0]);
});
it('generates dir element with correct attributes when calling add() with dir data', function() {
@@ -209,6 +210,7 @@ describe('OCA.Files.FileList tests', function() {
expect($tr.attr('data-mtime')).toEqual('123456');
expect($tr.find('.filesize').text()).toEqual('1 kB');
+ expect($tr.find('.date').text()).not.toEqual('?');
expect(fileList.findFileEl('testFolder')[0]).toEqual($tr[0]);
});
@@ -233,6 +235,7 @@ describe('OCA.Files.FileList tests', function() {
expect($tr.attr('data-mtime')).toEqual('123456');
expect($tr.find('.filesize').text()).toEqual('Pending');
+ expect($tr.find('.date').text()).not.toEqual('?');
});
it('generates dir element with default attributes when calling add() with minimal data', function() {
var fileData = {
@@ -254,6 +257,7 @@ describe('OCA.Files.FileList tests', function() {
expect($tr.attr('data-mtime')).toEqual('123456');
expect($tr.find('.filesize').text()).toEqual('Pending');
+ expect($tr.find('.date').text()).not.toEqual('?');
});
it('generates file element with zero size when size is explicitly zero', function() {
var fileData = {
@@ -264,6 +268,15 @@ describe('OCA.Files.FileList tests', function() {
var $tr = fileList.add(fileData);
expect($tr.find('.filesize').text()).toEqual('0 kB');
});
+ it('generates file element with unknown date when mtime invalid', function() {
+ var fileData = {
+ type: 'dir',
+ name: 'testFolder',
+ mtime: -1
+ };
+ var $tr = fileList.add(fileData);
+ expect($tr.find('.date').text()).toEqual('?');
+ });
it('adds new file to the end of the list', function() {
var $tr;
var fileData = {