@@ -183,6 +183,7 @@ describe('OCA.Files.FileList tests', function() {
183183 expect ( $tr . find ( '.nametext' ) . text ( ) . trim ( ) ) . toEqual ( 'testName.txt' ) ;
184184
185185 expect ( $tr . find ( '.filesize' ) . text ( ) ) . toEqual ( '1 kB' ) ;
186+ expect ( $tr . find ( '.date' ) . text ( ) ) . not . toEqual ( '?' ) ;
186187 expect ( fileList . findFileEl ( 'testName.txt' ) [ 0 ] ) . toEqual ( $tr [ 0 ] ) ;
187188 } ) ;
188189 it ( 'generates dir element with correct attributes when calling add() with dir data' , function ( ) {
@@ -209,6 +210,7 @@ describe('OCA.Files.FileList tests', function() {
209210 expect ( $tr . attr ( 'data-mtime' ) ) . toEqual ( '123456' ) ;
210211
211212 expect ( $tr . find ( '.filesize' ) . text ( ) ) . toEqual ( '1 kB' ) ;
213+ expect ( $tr . find ( '.date' ) . text ( ) ) . not . toEqual ( '?' ) ;
212214
213215 expect ( fileList . findFileEl ( 'testFolder' ) [ 0 ] ) . toEqual ( $tr [ 0 ] ) ;
214216 } ) ;
@@ -233,6 +235,7 @@ describe('OCA.Files.FileList tests', function() {
233235 expect ( $tr . attr ( 'data-mtime' ) ) . toEqual ( '123456' ) ;
234236
235237 expect ( $tr . find ( '.filesize' ) . text ( ) ) . toEqual ( 'Pending' ) ;
238+ expect ( $tr . find ( '.date' ) . text ( ) ) . not . toEqual ( '?' ) ;
236239 } ) ;
237240 it ( 'generates dir element with default attributes when calling add() with minimal data' , function ( ) {
238241 var fileData = {
@@ -254,6 +257,7 @@ describe('OCA.Files.FileList tests', function() {
254257 expect ( $tr . attr ( 'data-mtime' ) ) . toEqual ( '123456' ) ;
255258
256259 expect ( $tr . find ( '.filesize' ) . text ( ) ) . toEqual ( 'Pending' ) ;
260+ expect ( $tr . find ( '.date' ) . text ( ) ) . not . toEqual ( '?' ) ;
257261 } ) ;
258262 it ( 'generates file element with zero size when size is explicitly zero' , function ( ) {
259263 var fileData = {
@@ -264,6 +268,15 @@ describe('OCA.Files.FileList tests', function() {
264268 var $tr = fileList . add ( fileData ) ;
265269 expect ( $tr . find ( '.filesize' ) . text ( ) ) . toEqual ( '0 kB' ) ;
266270 } ) ;
271+ it ( 'generates file element with unknown date when mtime invalid' , function ( ) {
272+ var fileData = {
273+ type : 'dir' ,
274+ name : 'testFolder' ,
275+ mtime : - 1
276+ } ;
277+ var $tr = fileList . add ( fileData ) ;
278+ expect ( $tr . find ( '.date' ) . text ( ) ) . toEqual ( '?' ) ;
279+ } ) ;
267280 it ( 'adds new file to the end of the list' , function ( ) {
268281 var $tr ;
269282 var fileData = {
0 commit comments