diff --git a/packages/zowe-explorer/CHANGELOG.md b/packages/zowe-explorer/CHANGELOG.md index 282e77e1a7..f03690540f 100644 --- a/packages/zowe-explorer/CHANGELOG.md +++ b/packages/zowe-explorer/CHANGELOG.md @@ -8,6 +8,8 @@ All notable changes to the "vscode-extension-for-zowe" extension will be documen ### Bug fixes +- Fixed issue with `Submit JCL` losing focus on JCL being submitted, causing the wrong job submission. [#2616](https://github.com/zowe/vscode-extension-for-zowe/issues/2616) + ## `2.13.0` ### New features and enhancements diff --git a/packages/zowe-explorer/__tests__/__unit__/job/actions.unit.test.ts b/packages/zowe-explorer/__tests__/__unit__/job/actions.unit.test.ts index fc0d6e8e1e..464b6f0fda 100644 --- a/packages/zowe-explorer/__tests__/__unit__/job/actions.unit.test.ts +++ b/packages/zowe-explorer/__tests__/__unit__/job/actions.unit.test.ts @@ -477,21 +477,21 @@ describe("Jobs Actions Unit Tests - Function submitJcl", () => { new ZoweDatasetNode("node", vscode.TreeItemCollapsibleState.None, blockMocks.datasetSessionNode, null as any), blockMocks.datasetSessionNode, ]); - const commandSpy = jest.spyOn(vscode.commands, "executeCommand"); + const showTextDocumentSpy = jest.spyOn(vscode.window, "showTextDocument"); activeTextEditorDocument.mockReturnValue(blockMocks.textDocument); const submitJclSpy = jest.spyOn(blockMocks.jesApi, "submitJcl"); submitJclSpy.mockClear(); submitJclSpy.mockResolvedValueOnce(blockMocks.iJob); await dsActions.submitJcl(blockMocks.testDatasetTree, mockFile); - expect(commandSpy).toBeCalled(); + expect(showTextDocumentSpy).toBeCalled(); expect(submitJclSpy).toBeCalled(); expect(mocked(Gui.showMessage)).toBeCalled(); expect(mocked(Gui.showMessage).mock.calls.length).toBe(1); expect(mocked(Gui.showMessage).mock.calls[0][0]).toEqual( "Job submitted [JOB1234](command:zowe.jobs.setJobSpool?%5B%22sestest%22%2C%22JOB1234%22%5D)" ); - commandSpy.mockClear(); + showTextDocumentSpy.mockClear(); }); it("Checking submit of JCL file from VSC explorer tree", async () => { createGlobalMocks(); diff --git a/packages/zowe-explorer/src/dataset/actions.ts b/packages/zowe-explorer/src/dataset/actions.ts index 89d1cbdb02..2d1d265770 100644 --- a/packages/zowe-explorer/src/dataset/actions.ts +++ b/packages/zowe-explorer/src/dataset/actions.ts @@ -992,7 +992,7 @@ export async function submitJcl(datasetProvider: api.IZoweTree