diff --git a/src/features/exporter/test/exporter.spec.js b/src/features/exporter/test/exporter.spec.js index 378a7c279b..8a1e1b9550 100644 --- a/src/features/exporter/test/exporter.spec.js +++ b/src/features/exporter/test/exporter.spec.js @@ -176,14 +176,17 @@ describe('ui.grid.exporter uiGridExporterService', function () { {name: 'col3', displayName: 'Col3', width: 100, align: 'left'}, {name: 'x', displayName: '12345234', width: 200, align: 'left'} ]; + + var date = new Date(2014, 11, 12, 0, 0, 0, 0); + var data = [ [ 'a string', 'a string', 'A string', 'a string' ], [ '', '45', 'A string', false ], - [ new Date('2014-12-12'), 45, 'A string', true ] + [ date, 45, 'A string', true ] ]; expect(uiGridExporterService.formatAsCsv(columnHeaders, data)).toEqual( - '"Col1","Col2","Col3","12345234"\n"a string","a string","A string","a string"\n"","45","A string",FALSE\n"2014-12-12T00:00:00.000Z",45,"A string",TRUE' + '"Col1","Col2","Col3","12345234"\n"a string","a string","A string","a string"\n"","45","A string",FALSE\n"' + date.toISOString() + '",45,"A string",TRUE' ); }); }); @@ -233,10 +236,13 @@ describe('ui.grid.exporter uiGridExporterService', function () { {name: 'col3', displayName: 'Col3', width: 100, align: 'left'}, {name: 'x', displayName: '12345234', width: 200, align: 'left'} ]; + + var date = new Date(2014, 11, 12, 0, 0, 0, 0); + var data = [ [ 'a string', 'a string', 'A string', 'a string' ], [ '', '45', 'A string', false ], - [ new Date('2014-12-12'), 45, 'A string', true ] + [ date, 45, 'A string', true ] ]; var result = uiGridExporterService.prepareAsPdf(grid, columnHeaders, data); @@ -256,7 +262,7 @@ describe('ui.grid.exporter uiGridExporterService', function () { ], [ 'a string', 'a string', 'A string', 'a string' ], [ '', '45', 'A string', 'FALSE' ], - [ "2014-12-12T00:00:00.000Z", '45', 'A string', 'TRUE' ] + [ date.toISOString(), '45', 'A string', 'TRUE' ] ] } }], @@ -295,10 +301,13 @@ describe('ui.grid.exporter uiGridExporterService', function () { {name: 'col3', displayName: 'Col3', width: 100, align: 'left'}, {name: 'x', displayName: '12345234', width: 200, align: 'left'} ]; + + var date = new Date(2014, 12, 12, 0, 0, 0, 0); + var data = [ [ 'a string', 'a string', 'A string', 'a string' ], [ '', '45', 'A string', false ], - [ new Date('2014-12-12'), 45, 'A string', true ] + [ date, 45, 'A string', true ] ]; var result = uiGridExporterService.prepareAsPdf(grid, columnHeaders, data); @@ -318,7 +327,7 @@ describe('ui.grid.exporter uiGridExporterService', function () { ], [ 'a string', 'a string', 'A string', 'a string' ], [ '', '45', 'A string', 'FALSE' ], - [ '2014-12-12T00:00:00.000Z', '45', 'A string', 'TRUE' ] + [ date.toISOString(), '45', 'A string', 'TRUE' ] ] } } ], diff --git a/test/unit/core/row-sorting.spec.js b/test/unit/core/row-sorting.spec.js index fd0f09e742..ce97e7a7c8 100644 --- a/test/unit/core/row-sorting.spec.js +++ b/test/unit/core/row-sorting.spec.js @@ -243,7 +243,7 @@ describe('rowSorter', function() { sortNumber: [ undefined, null, 1, 2 ], sortNumberStr: [ undefined, null, '3.a5', '5.b7' ], sortAlpha: [ undefined, null, 'a', 'b' ], - sortDate: [ undefined, null, new Date('2009-12-12'), new Date('2010-11-11') ], + sortDate: [ undefined, null, new Date(2009, 12, 12), new Date(2010, 11, 11) ], sortBool: [ undefined, null, false, true ] };