Skip to content

Commit

Permalink
refactor jv-scheduler : add test cases for scheduleValidator file
Browse files Browse the repository at this point in the history
  • Loading branch information
anthomba-tibco committed Nov 21, 2024
1 parent 71a8419 commit 2b6e88e
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ describe("scheduleValidators", () => {
it("should return folder error for valid folder URI with permission granted", async () => {
const folderUri = "/valid/folder/uri";
const result = await validator(ERROR_FIELDS.FOLDER_URI, folderUri);
expect(result).toEqual({ folderURI: undefined });
expect(result.folderURI).toBeDefined;
});

it("should return folder error for valid folder URI with permission not granted", async () => {
Expand All @@ -184,7 +184,9 @@ describe("scheduleValidators", () => {
permissionMask: "none",
});
const result = await validator(ERROR_FIELDS.FOLDER_URI, folderUri);
expect(result).toEqual({ folderURI: '"error.invalid_uri' });
expect(result).toEqual({
folderURI: "error.report.schedule.output.folder.notwriteable",
});
});

it("should return folder error for invalid folder URI", async () => {
Expand All @@ -193,7 +195,9 @@ describe("scheduleValidators", () => {
responseJSON: { errorCode: "invalid_uri" },
});
const result = await validator(ERROR_FIELDS.FOLDER_URI, folderUri);
expect(result).toEqual({ folderURI: "error.invalid_uri" });
expect(result).toEqual({
folderURI: "error.report.schedule.output.folder.notwriteable",
});
});
});

Expand Down

0 comments on commit 2b6e88e

Please sign in to comment.