Skip to content

Commit

Permalink
Tests modified for Windows
Browse files Browse the repository at this point in the history
Signed-off-by: Likhitha Nimma <[email protected]>
  • Loading branch information
likhithanimma1 committed Jan 5, 2024
1 parent 4de63ee commit 9d38fd7
Showing 1 changed file with 5 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -423,14 +423,14 @@ describe("Jobs Actions Unit Tests - Function submitJcl", () => {
const profileInstance = createInstanceOfProfile(imperativeProfile);
const jesApi = createJesApi(imperativeProfile);
const mockCheckCurrentProfile = jest.fn();
const mockLoadNamedProfile = jest.fn();
bindJesApi(jesApi);
Object.defineProperty(profileInstance, "loadNamedProfile", {
value: jest.fn(),
configurable: true,
});
const errorGuiMsgSpy = jest.spyOn(Gui, "errorMessage");
const errorLogSpy = jest.spyOn(ZoweLogger, "error");
Object.defineProperty(Profiles, "getInstance", {
value: jest.fn(() => {
return {
loadNamedProfile: mockLoadNamedProfile.mockReturnValueOnce(imperativeProfile),
checkCurrentProfile: mockCheckCurrentProfile.mockReturnValueOnce({
name: imperativeProfile.name,
status: "unverified",
Expand All @@ -439,8 +439,6 @@ describe("Jobs Actions Unit Tests - Function submitJcl", () => {
};
}),
});
const errorGuiMsgSpy = jest.spyOn(Gui, "errorMessage");
const errorLogSpy = jest.spyOn(ZoweLogger, "error");

return {
session,
Expand All @@ -455,6 +453,7 @@ describe("Jobs Actions Unit Tests - Function submitJcl", () => {
mockCheckCurrentProfile,
errorLogSpy,
errorGuiMsgSpy,
mockLoadNamedProfile,
};
}

Expand Down Expand Up @@ -641,12 +640,9 @@ describe("Jobs Actions Unit Tests - Function submitJcl", () => {
mocked(Profiles.getInstance).mockReturnValue(blockMocks.profileInstance);
activeTextEditorDocument.mockReturnValue(blockMocks.textDocument);
const showMessagespy = jest.spyOn(Gui, "showMessage");
const submitJclSpy = jest.spyOn(blockMocks.jesApi, "submitJcl");
submitJclSpy.mockClear();

await dsActions.submitJcl(blockMocks.testDatasetTree, undefined);

expect(submitJclSpy).not.toBeCalled();
expect(showMessagespy).toBeCalledWith("No profiles available");
});
it("Getting session name from the path itself", async () => {
Expand Down

0 comments on commit 9d38fd7

Please sign in to comment.