diff --git a/packages/zowe-explorer/__tests__/__unit__/trees/uss/USSTree.unit.test.ts b/packages/zowe-explorer/__tests__/__unit__/trees/uss/USSTree.unit.test.ts index e3709ba0aa..12a9831ee4 100644 --- a/packages/zowe-explorer/__tests__/__unit__/trees/uss/USSTree.unit.test.ts +++ b/packages/zowe-explorer/__tests__/__unit__/trees/uss/USSTree.unit.test.ts @@ -628,8 +628,6 @@ describe("USSTree Unit Tests - Function filterPrompt", () => { globalMocks.showInputBox.mockReturnValueOnce(undefined); await globalMocks.testTree.filterPrompt(globalMocks.testTree.mSessionNodes[1]); - expect(globalMocks.showInformationMessage.mock.calls.length).toBe(1); - expect(globalMocks.showInformationMessage.mock.calls[0][0]).toBe("You must enter a path."); }); it("Tests that filter() works on a file", async () => { diff --git a/packages/zowe-explorer/src/trees/uss/USSTree.ts b/packages/zowe-explorer/src/trees/uss/USSTree.ts index cc741e35a1..7d244b5d3b 100644 --- a/packages/zowe-explorer/src/trees/uss/USSTree.ts +++ b/packages/zowe-explorer/src/trees/uss/USSTree.ts @@ -744,11 +744,11 @@ export class USSTree extends ZoweTreeProvider implements Types const options: vscode.InputBoxOptions = { placeHolder: vscode.l10n.t("New filter"), value: remotepath, + validateInput: (input: string) => (input.length > 0 ? null : vscode.l10n.t("Please enter a valid USS path.")), }; // get user input remotepath = await Gui.showInputBox(options); - if (!remotepath || remotepath.length === 0) { - Gui.showMessage(vscode.l10n.t("You must enter a path.")); + if (remotepath == null) { return; } } else {