Skip to content

Commit

Permalink
Fix zowe#3422
Browse files Browse the repository at this point in the history
Signed-off-by: JWaters02 <watersjoshua2002@gmail.com>
  • Loading branch information
JWaters02 committed Feb 6, 2025
1 parent eeeaf84 commit 373b527
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,13 @@ describe("ZoweCommandProvider Unit Tests", () => {
expect(createTerminal).not.toHaveBeenCalled();
});

it("should not create a terminal if the command is empty", async () => {
const createTerminal = jest.fn().mockReturnValue({ show: jest.fn() });
Object.defineProperty(vscode.window, "createTerminal", { value: createTerminal, configurable: true });
await ZoweCommandProvider.prototype.issueCommand.call(mockCmdProvider, testProfile, "");
expect(createTerminal).not.toHaveBeenCalled();
});

it("should create an integrated terminal", async () => {
const createTerminal = jest.fn().mockReturnValue({ show: jest.fn() });
Object.defineProperty(vscode.window, "createTerminal", { value: createTerminal, configurable: true });
Expand Down
4 changes: 4 additions & 0 deletions packages/zowe-explorer/src/commands/ZoweCommandProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ export abstract class ZoweCommandProvider {
if (profile == null || command == null) {
return;
}
if (command.length === 0) {
Gui.showMessage(this.operationCancelled);
return;
}
try {
const iTerms = SettingsConfig.getDirectValue(Constants.SETTINGS_COMMANDS_INTEGRATED_TERMINALS);
if (iTerms) {
Expand Down

0 comments on commit 373b527

Please # to comment.