Skip to content

Commit 42e172b

Browse files
prx-lmomportuga
authored andcommitted
unit test adventure
1 parent 3f8b13c commit 42e172b

File tree

1 file changed

+1
-72
lines changed

1 file changed

+1
-72
lines changed

packages/exporter/test/exporter.spec.js

Lines changed: 1 addition & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -738,19 +738,6 @@ describe('ui.grid.exporter', function() {
738738
callback();
739739
}
740740
});
741-
spyOn(uiGridExporterService, 'exporterCsvFilename');
742-
grid.options.exporterCsvFilename = function(grid, rowTypes, colTypes) {
743-
if (!grid) {
744-
throw Error("got erroneous Parameter: no grid");
745-
}
746-
if (rowTypes != uiGridExporterConstants.VISIBLE) {
747-
throw Error("got erroneous Parameter: rowTypes != uiGridExporterConstants.VISIBLE");
748-
}
749-
if (colTypes != uiGridExporterConstants.VISIBLE) {
750-
throw Error("got erroneous Parameter: colTypes != uiGridExporterConstants.VISIBLE");
751-
}
752-
return "test";
753-
}
754741
uiGridExporterService.csvExport(grid, uiGridExporterConstants.VISIBLE, uiGridExporterConstants.VISIBLE);
755742
});
756743
afterEach(function() {
@@ -763,9 +750,6 @@ describe('ui.grid.exporter', function() {
763750
it('calls downloadFile', function() {
764751
expect(uiGridExporterService.downloadFile).toHaveBeenCalled();
765752
});
766-
it('calls exporterCsvFilename', function() {
767-
expect(uiGridExporterService.exporterCsvFilename).toHaveBeenCalled();
768-
});
769753
});
770754

771755
describe('loadAllDataIfNeeded', function() {
@@ -789,7 +773,7 @@ describe('ui.grid.exporter', function() {
789773
it('calls exporterAllDataFn', function() {
790774
expect(grid.options.exporterAllDataFn).toHaveBeenCalled();
791775
});
792-
it('calls exporterAllDataFn', function() {
776+
it('calls modifyRows', function() {
793777
expect(grid.modifyRows).toHaveBeenCalled();
794778
});
795779
});
@@ -1059,24 +1043,6 @@ describe('ui.grid.exporter', function() {
10591043
uiGridExporterService.pdfExport(grid, uiGridExporterConstants.ALL);
10601044
expect(uiGridExporterService.loadAllDataIfNeeded).toHaveBeenCalled();
10611045
});
1062-
it('calls exporterPdfFilename', function() {
1063-
spyOn(uiGridExporterService, 'exporterPdfFilename');
1064-
grid.options.exporterPdfFilename = function(grid, rowTypes, colTypes) {
1065-
if (!grid) {
1066-
throw Error("got erroneous Parameter: no grid");
1067-
}
1068-
if (rowTypes != uiGridExporterConstants.VISIBLE) {
1069-
throw Error("got erroneous Parameter: rowTypes != uiGridExporterConstants.VISIBLE");
1070-
}
1071-
if (colTypes != uiGridExporterConstants.VISIBLE) {
1072-
throw Error("got erroneous Parameter: colTypes != uiGridExporterConstants.VISIBLE");
1073-
}
1074-
return "test";
1075-
}
1076-
1077-
uiGridExporterService.pdfExport(grid, uiGridExporterConstants.ALL);
1078-
expect(uiGridExporterService.exporterPdfFilename).toHaveBeenCalled();
1079-
});
10801046
});
10811047

10821048
describe('prepareAsPdf', function() {
@@ -1358,43 +1324,6 @@ describe('ui.grid.exporter', function() {
13581324
uiGridExporterService.excelExport(grid, uiGridExporterConstants.ALL);
13591325
expect(uiGridExporterService.loadAllDataIfNeeded).toHaveBeenCalled();
13601326
});
1361-
1362-
it('calls exporterExcelFilename', function() {
1363-
spyOn(uiGridExporterService, 'exporterExcelFilename');
1364-
grid.options.exporterExcelFilename = function(grid, rowTypes, colTypes) {
1365-
if (!grid) {
1366-
throw Error("got erroneous Parameter: no grid");
1367-
}
1368-
if (rowTypes != uiGridExporterConstants.VISIBLE) {
1369-
throw Error("got erroneous Parameter: rowTypes != uiGridExporterConstants.VISIBLE");
1370-
}
1371-
if (colTypes != uiGridExporterConstants.VISIBLE) {
1372-
throw Error("got erroneous Parameter: colTypes != uiGridExporterConstants.VISIBLE");
1373-
}
1374-
return "test";
1375-
}
1376-
1377-
uiGridExporterService.excelExport(grid, uiGridExporterConstants.ALL);
1378-
expect(uiGridExporterService.exporterExcelFilename).toHaveBeenCalled();
1379-
});
1380-
it('calls exporterExcelSheetName', function() {
1381-
spyOn(uiGridExporterService, 'exporterExcelSheetName');
1382-
grid.options.exporterExcelSheetName = function(grid, rowTypes, colTypes) {
1383-
if (!grid) {
1384-
throw Error("got erroneous Parameter: no grid");
1385-
}
1386-
if (rowTypes != uiGridExporterConstants.VISIBLE) {
1387-
throw Error("got erroneous Parameter: rowTypes != uiGridExporterConstants.VISIBLE");
1388-
}
1389-
if (colTypes != uiGridExporterConstants.VISIBLE) {
1390-
throw Error("got erroneous Parameter: colTypes != uiGridExporterConstants.VISIBLE");
1391-
}
1392-
return "test";
1393-
}
1394-
1395-
uiGridExporterService.excelExport(grid, uiGridExporterConstants.ALL);
1396-
expect(uiGridExporterService.exporterExcelSheetName).toHaveBeenCalled();
1397-
});
13981327
});
13991328
});
14001329

0 commit comments

Comments
 (0)