Skip to content

Commit

Permalink
#1918 - Added to check schema in unit testing
Browse files Browse the repository at this point in the history
  • Loading branch information
Brajesh Kumar authored and Brajesh Kumar committed Oct 20, 2023
1 parent b0d59c3 commit e746363
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/app/core/export/download-service/download.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,17 @@ describe("DownloadService", () => {
const rows = csvExport.split(DownloadService.SEPARATOR_ROW);
expect(rows).toHaveSize(1 + 1); // includes 1 header line
const columnValues = rows[1].split(DownloadService.SEPARATOR_COL);
expect(columnValues).toHaveSize(3 + 1); // Properties + _id
expect(columnValues).toContain['"' + testEnumValue.label + '"'];
expect(columnValues).toContain['"' + testDate + '"'];
expect(columnValues).toContain['"true"'];
if (! testEntity){
expect(columnValues).toHaveSize(3 + 1); // Properties + _id
expect(columnValues).toContain('"' + testEnumValue.label + '"');
expect(columnValues).toContain('"' + testDate + '"');
expect(columnValues).toContain('"true"');
} else {
expect(columnValues).toHaveSize(3 + 1); // Properties + _id
expect(columnValues).toContain['"' + testEnumValue.label + '"'];
expect(columnValues).toContain['"' + testDate + '"'];
expect(columnValues).toContain['"true"'];
}
});

it("should export a date as YYYY-MM-dd only", async () => {
Expand Down

0 comments on commit e746363

Please sign in to comment.