From e25f025671f3a555c59db750fa320e442f0b20c0 Mon Sep 17 00:00:00 2001 From: "Andrew W. Harn" Date: Thu, 18 Jul 2024 15:16:44 -0400 Subject: [PATCH 1/4] Fixes profile creation error with new base profile naming changes Signed-off-by: Andrew W. Harn --- .../__tests__/__mocks__/@zowe/imperative.ts | 4 +- .../__mocks__/mockCreators/shared.ts | 1 + .../configuration/Profiles.unit.test.ts | 142 +++++++++++++----- .../src/configuration/Profiles.ts | 2 +- 4 files changed, 106 insertions(+), 43 deletions(-) diff --git a/packages/zowe-explorer/__tests__/__mocks__/@zowe/imperative.ts b/packages/zowe-explorer/__tests__/__mocks__/@zowe/imperative.ts index e7bb992995..8193408f79 100644 --- a/packages/zowe-explorer/__tests__/__mocks__/@zowe/imperative.ts +++ b/packages/zowe-explorer/__tests__/__mocks__/@zowe/imperative.ts @@ -367,7 +367,7 @@ export class ConfigBuilder { }, secure: [], }, - base: { + global_base: { type: "base", properties: { host: "sample.com", @@ -378,7 +378,7 @@ export class ConfigBuilder { }, defaults: { zosmf: "zosmf", - base: "base", + base: "global_base", }, autoStore: true, }; diff --git a/packages/zowe-explorer/__tests__/__mocks__/mockCreators/shared.ts b/packages/zowe-explorer/__tests__/__mocks__/mockCreators/shared.ts index 559b267222..9a843d2513 100644 --- a/packages/zowe-explorer/__tests__/__mocks__/mockCreators/shared.ts +++ b/packages/zowe-explorer/__tests__/__mocks__/mockCreators/shared.ts @@ -527,6 +527,7 @@ export function createConfigLoad() { api: { layers: { merge: jest.fn(), + activate: jest.fn(), }, }, layers: [ diff --git a/packages/zowe-explorer/__tests__/__unit__/configuration/Profiles.unit.test.ts b/packages/zowe-explorer/__tests__/__unit__/configuration/Profiles.unit.test.ts index 9641ab02a1..f0062f549e 100644 --- a/packages/zowe-explorer/__tests__/__unit__/configuration/Profiles.unit.test.ts +++ b/packages/zowe-explorer/__tests__/__unit__/configuration/Profiles.unit.test.ts @@ -282,8 +282,8 @@ describe("Profiles Unit Tests - Function createZoweSession", () => { return newMocks; } it("Tests that createZoweSession presents correct message when escaping selection of quickpick", async () => { - const globalMocks = await createGlobalMocks(); - const blockMocks = await createBlockMocks(globalMocks); + const globalMocks = createGlobalMocks(); + const blockMocks = createBlockMocks(globalMocks); const spy = jest.spyOn(Gui, "createQuickPick"); jest.spyOn(Gui, "resolveQuickPick").mockResolvedValueOnce(undefined); await Profiles.getInstance().createZoweSession(blockMocks.testDatasetTree); @@ -294,7 +294,7 @@ describe("Profiles Unit Tests - Function createZoweSession", () => { }); it("Tests that createZoweSession runs successfully", async () => { - const globalMocks = await createGlobalMocks(); + const globalMocks = createGlobalMocks(); const spyConfig = jest.spyOn(Profiles.getInstance(), "openConfigFile"); jest.spyOn(Gui, "createQuickPick").mockReturnValue({ show: jest.fn(), @@ -311,7 +311,7 @@ describe("Profiles Unit Tests - Function createZoweSession", () => { }); it("Tests that createZoweSession catches error and log warning", async () => { - const globalMocks = await createGlobalMocks(); + const globalMocks = createGlobalMocks(); jest.spyOn(Gui, "createQuickPick").mockReturnValue({ show: jest.fn(), hide: jest.fn(), @@ -327,7 +327,7 @@ describe("Profiles Unit Tests - Function createZoweSession", () => { describe("Profiles Unit Tests - Function editZoweConfigFile", () => { it("Tests that editZoweConfigFile presents correct message when escaping selection of quickpick", async () => { - const globalMocks = await createGlobalMocks(); + const globalMocks = createGlobalMocks(); const spy = jest.spyOn(Gui, "showQuickPick"); spy.mockResolvedValueOnce(undefined); @@ -337,7 +337,7 @@ describe("Profiles Unit Tests - Function editZoweConfigFile", () => { spy.mockClear(); }); it("Tests that editZoweConfigFile opens correct file when Global is selected", async () => { - const globalMocks = await createGlobalMocks(); + const globalMocks = createGlobalMocks(); const spyQuickPick = jest.spyOn(Gui, "showQuickPick"); spyQuickPick.mockResolvedValueOnce("Global: in the Zowe home directory" as any); @@ -349,7 +349,7 @@ describe("Profiles Unit Tests - Function editZoweConfigFile", () => { spyOpenFile.mockClear(); }); it("Tests that editZoweConfigFile opens correct file when only Global config available", async () => { - const globalMocks = await createGlobalMocks(); + const globalMocks = createGlobalMocks(); globalMocks.mockConfigLoad.load.mockResolvedValueOnce({ layers: [ { @@ -367,7 +367,7 @@ describe("Profiles Unit Tests - Function editZoweConfigFile", () => { spyOpenFile.mockClear(); }); it("Tests that editZoweConfigFile opens correct file when Project is selected", async () => { - const globalMocks = await createGlobalMocks(); + const globalMocks = createGlobalMocks(); const spyQuickPick = jest.spyOn(Gui, "showQuickPick"); spyQuickPick.mockResolvedValueOnce("Project: in the current working directory" as any); @@ -379,7 +379,7 @@ describe("Profiles Unit Tests - Function editZoweConfigFile", () => { spyOpenFile.mockClear(); }); it("Tests that editZoweConfigFile opens correct file when only Project config available", async () => { - const globalMocks = await createGlobalMocks(); + const globalMocks = createGlobalMocks(); globalMocks.mockConfigLoad.load.mockResolvedValueOnce({ layers: [ { @@ -399,6 +399,7 @@ describe("Profiles Unit Tests - Function editZoweConfigFile", () => { }); describe("Profiles Unit Tests - Function createZoweSchema", () => { + const mockWorkspaceFolders = jest.fn(); function createBlockMocks(globalMocks) { const newMocks = { session: createISessionWithoutCredentials(), @@ -422,9 +423,14 @@ describe("Profiles Unit Tests - Function createZoweSchema", () => { return newMocks; } + + afterAll(() => { + jest.restoreAllMocks(); + }); + it("Tests that createZoweSchema presents correct message when escaping selection of config location prompt", async () => { - const globalMocks = await createGlobalMocks(); - const blockMocks = await createBlockMocks(globalMocks); + const globalMocks = createGlobalMocks(); + const blockMocks = createBlockMocks(globalMocks); const spy = jest.spyOn(Gui, "showQuickPick"); spy.mockResolvedValueOnce(undefined); @@ -434,8 +440,8 @@ describe("Profiles Unit Tests - Function createZoweSchema", () => { spy.mockClear(); }); it("Tests that createZoweSchema will open correct config file when cancelling creation in location with existing config file", async () => { - const globalMocks = await createGlobalMocks(); - const blockMocks = await createBlockMocks(globalMocks); + const globalMocks = createGlobalMocks(); + const blockMocks = createBlockMocks(globalMocks); const spyQuickPick = jest.spyOn(Gui, "showQuickPick"); globalMocks.mockShowQuickPick.mockResolvedValueOnce("Global: in the Zowe home directory"); @@ -456,8 +462,8 @@ describe("Profiles Unit Tests - Function createZoweSchema", () => { spyOpenFile.mockClear(); }); it("Test that createZoweSchema will open config on error if error deals with parsing file", async () => { - const globalMocks = await createGlobalMocks(); - const blockMocks = await createBlockMocks(globalMocks); + const globalMocks = createGlobalMocks(); + const blockMocks = createBlockMocks(globalMocks); const spyQuickPick = jest.spyOn(Gui, "showQuickPick"); globalMocks.mockShowQuickPick.mockResolvedValueOnce("Global: in the Zowe home directory"); @@ -474,8 +480,8 @@ describe("Profiles Unit Tests - Function createZoweSchema", () => { spyZoweConfigError.mockClear(); }); it("Test that createZoweSchema will auto create global if VSC not in project and config doesn't exist", async () => { - const globalMocks = await createGlobalMocks(); - const blockMocks = await createBlockMocks(globalMocks); + const globalMocks = createGlobalMocks(); + const blockMocks = createBlockMocks(globalMocks); Object.defineProperty(vscode.workspace, "workspaceFolders", { get: () => undefined, configurable: true, @@ -514,8 +520,8 @@ describe("Profiles Unit Tests - Function createZoweSchema", () => { }); it("Tests that createZoweSchema will return the config file path", async () => { - const globalMocks = await createGlobalMocks(); - const blockMocks = await createBlockMocks(globalMocks); + const globalMocks = createGlobalMocks(); + const blockMocks = createBlockMocks(globalMocks); Object.defineProperty(vscode.workspace, "workspaceFolders", { value: undefined, @@ -545,6 +551,62 @@ describe("Profiles Unit Tests - Function createZoweSchema", () => { await expect(Profiles.getInstance().createZoweSchema(blockMocks.testDatasetTree)).resolves.toBe(expectedValue); }); + + it("Test that createZoweSchema will create global configuration", async () => { + const globalMocks = createGlobalMocks(); + const blockMocks = createBlockMocks(globalMocks); + + const spyQuickPick = jest.spyOn(Gui, "showQuickPick"); + globalMocks.mockShowQuickPick.mockResolvedValueOnce("Global: in the Zowe home directory"); + const spyLayers = jest.spyOn(Profiles.getInstance() as any, "checkExistingConfig").mockReturnValueOnce("zowe"); + const spyConfigBuilder = jest.spyOn(imperative.ConfigBuilder, "build"); + const spyZoweConfigError = jest.spyOn(ZoweExplorerExtender, "showZoweConfigError"); + const spyGuiErrorMessage = jest.spyOn(Gui, "errorMessage").mockResolvedValueOnce("Show config"); + jest.spyOn(SettingsConfig, "getDirectValue").mockReturnValueOnce(undefined); + await Profiles.getInstance().createZoweSchema(blockMocks.testDatasetTree); + + expect(spyQuickPick).toHaveBeenCalledTimes(1); + expect(spyZoweConfigError).not.toHaveBeenCalled(); + expect(spyGuiErrorMessage).not.toHaveBeenCalled(); + expect(spyConfigBuilder).toHaveBeenCalledTimes(1); + expect(spyConfigBuilder.mock.calls[0][1]).toEqual(true); // make sure that global was true + + spyQuickPick.mockClear(); + spyLayers.mockClear(); + spyZoweConfigError.mockClear(); + }); + + it("Test that createZoweSchema will create local configuration", async () => { + const globalMocks = createGlobalMocks(); + const blockMocks = createBlockMocks(globalMocks); + Object.defineProperty(vscode.workspace, "workspaceFolders", { + get: mockWorkspaceFolders.mockReturnValue([ + { + uri: { fsPath: "fakePath" }, + }, + ]), + configurable: true, + }); + + const spyQuickPick = jest.spyOn(Gui, "showQuickPick"); + globalMocks.mockShowQuickPick.mockResolvedValueOnce("Project: in the current working directory"); + const spyLayers = jest.spyOn(Profiles.getInstance() as any, "checkExistingConfig").mockReturnValueOnce("zowe"); + const spyConfigBuilder = jest.spyOn(imperative.ConfigBuilder, "build"); + const spyZoweConfigError = jest.spyOn(ZoweExplorerExtender, "showZoweConfigError"); + const spyGuiErrorMessage = jest.spyOn(Gui, "errorMessage").mockResolvedValueOnce("Show config"); + jest.spyOn(SettingsConfig, "getDirectValue").mockReturnValueOnce(undefined); + await Profiles.getInstance().createZoweSchema(blockMocks.testDatasetTree); + + expect(spyQuickPick).toHaveBeenCalledTimes(1); + expect(spyZoweConfigError).not.toHaveBeenCalled(); + expect(spyGuiErrorMessage).not.toHaveBeenCalled(); + expect(spyConfigBuilder).toHaveBeenCalledTimes(1); + expect(spyConfigBuilder.mock.calls[0][1]).toEqual(false); // make sure that global was false + + spyQuickPick.mockClear(); + spyLayers.mockClear(); + spyZoweConfigError.mockClear(); + }); }); describe("Profiles Unit Tests - function getProfileIcon", () => { @@ -771,7 +833,7 @@ describe("Profiles Unit Tests - function validateProfile", () => { describe("Profiles Unit Tests - function deleteProfile", () => { it("should delete profile", async () => { - const globalMocks = await createGlobalMocks(); + const globalMocks = createGlobalMocks(); const datasetSessionNode = createDatasetSessionNode(globalMocks.testSession, globalMocks.testProfile); const datasetTree = createDatasetTree(datasetSessionNode, globalMocks.testProfile); @@ -875,7 +937,7 @@ describe("Profiles Unit Tests - function checkCurrentProfile", () => { }; it("should show as active in status of profile", async () => { - const globalMocks = await createGlobalMocks(); + const globalMocks = createGlobalMocks(); environmentSetup(globalMocks); setupProfilesCheck(globalMocks); jest.spyOn(Profiles.getInstance(), "validateProfiles").mockReturnValue({ status: "active", name: "sestest" } as any); @@ -883,19 +945,19 @@ describe("Profiles Unit Tests - function checkCurrentProfile", () => { await expect(Profiles.getInstance().checkCurrentProfile(globalMocks.testProfile)).resolves.toEqual({ name: "sestest", status: "active" }); }); it("should show as unverified in status of profile", async () => { - const globalMocks = await createGlobalMocks(); + const globalMocks = createGlobalMocks(); environmentSetup(globalMocks); setupProfilesCheck(globalMocks); jest.spyOn(Profiles.getInstance(), "promptCredentials").mockResolvedValue(undefined as any); await expect(Profiles.getInstance().checkCurrentProfile(globalMocks.testProfile)).resolves.toEqual({ name: "sestest", status: "unverified" }); }); it("should show as inactive in status of profile", async () => { - const globalMocks = await createGlobalMocks(); + const globalMocks = createGlobalMocks(); setupProfilesCheck(globalMocks); await expect(Profiles.getInstance().checkCurrentProfile(globalMocks.testProfile)).resolves.toEqual({ name: "sestest", status: "inactive" }); }); it("should throw an error if using token auth and is logged out or has expired token", async () => { - const globalMocks = await createGlobalMocks(); + const globalMocks = createGlobalMocks(); jest.spyOn(AuthUtils, "errorHandling").mockImplementation(); jest.spyOn(AuthUtils, "isUsingTokenAuth").mockResolvedValue(true); setupProfilesCheck(globalMocks); @@ -905,7 +967,7 @@ describe("Profiles Unit Tests - function checkCurrentProfile", () => { describe("Profiles Unit Tests - function getProfileSetting", () => { it("should retrive the profile with a status of unverified", async () => { - const globalMocks = await createGlobalMocks(); + const globalMocks = createGlobalMocks(); Object.defineProperty(Profiles.getInstance(), "profilesValidationSetting", { value: [ { @@ -948,7 +1010,7 @@ describe("Profiles Unit Tests - function getProfileSetting", () => { describe("Profiles Unit Tests - function disableValidationContext", () => { it("should disable validation context and return updated node", async () => { - const globalMocks = await createGlobalMocks(); + const globalMocks = createGlobalMocks(); const testNode = new (ZoweTreeNode as any)( "test", vscode.TreeItemCollapsibleState.None, @@ -971,7 +1033,7 @@ describe("Profiles Unit Tests - function disableValidationContext", () => { describe("Profiles Unit Tests - function enableValidationContext", () => { it("should enable validation context and return updated node", async () => { - const globalMocks = await createGlobalMocks(); + const globalMocks = createGlobalMocks(); const testNode = new (ZoweTreeNode as any)( "test", vscode.TreeItemCollapsibleState.None, @@ -995,7 +1057,7 @@ describe("Profiles Unit Tests - function ssoLogin", () => { let testNode; let globalMocks; beforeEach(async () => { - globalMocks = await createGlobalMocks(); + globalMocks = createGlobalMocks(); testNode = new (ZoweTreeNode as any)( "fake", vscode.TreeItemCollapsibleState.None, @@ -1061,7 +1123,7 @@ describe("Profiles Unit Tests - function ssoLogout", () => { let testNode; let globalMocks; beforeEach(async () => { - globalMocks = await createGlobalMocks(); + globalMocks = createGlobalMocks(); testNode = new (ZoweTreeNode as any)( "fake", vscode.TreeItemCollapsibleState.None, @@ -1109,7 +1171,7 @@ describe("Profiles Unit Tests - function ssoLogout", () => { describe("Profiles Unit Tests - function updateBaseProfileFileLogin", () => { it("should update the property of mProfileInfo", async () => { const privateProfile = Profiles.getInstance() as any; - const globalMocks = await createGlobalMocks(); + const globalMocks = createGlobalMocks(); const updatePropertyMock = jest.fn(); jest.spyOn(privateProfile, "getProfileInfo").mockReturnValue({ isSecured: () => true, @@ -1123,7 +1185,7 @@ describe("Profiles Unit Tests - function updateBaseProfileFileLogin", () => { describe("Profiles Unit Tests - function updateBaseProfileFileLogout", () => { it("should update the property of mProfileInfo", async () => { const privateProfile = Profiles.getInstance() as any; - const globalMocks = await createGlobalMocks(); + const globalMocks = createGlobalMocks(); const updateKnownPropertyMock = jest.fn(); jest.spyOn(privateProfile, "getProfileInfo").mockReturnValue({ isSecured: () => true, @@ -1142,7 +1204,7 @@ describe("Profiles Unit Tests - function updateBaseProfileFileLogout", () => { describe("Profiles Unit Tests - function createNonSecureProfile", () => { it("should create an unsecured profile by removing secure arrays and setting autoStore to false", async () => { - const globalMocks = await createGlobalMocks(); + const globalMocks = createGlobalMocks(); const changingConfig = globalMocks.testTeamConfigProfile; const privateProfile = Profiles.getInstance() as any; Object.defineProperty(SettingsConfig, "getDirectValue", { @@ -1156,7 +1218,7 @@ describe("Profiles Unit Tests - function createNonSecureProfile", () => { describe("Profiles Unit Tests - function validationArraySetup", () => { it("should setup the validation array", async () => { - const globalMocks = await createGlobalMocks(); + const globalMocks = createGlobalMocks(); Object.defineProperty(Profiles.getInstance(), "profilesValidationSetting", { value: [ { @@ -1212,7 +1274,7 @@ describe("Profiles Unit Tests - function getSecurePropsForProfile", () => { jest.resetAllMocks(); }); it("should retrieve the secure properties of a profile", async () => { - const globalMocks = await createGlobalMocks(); + const globalMocks = createGlobalMocks(); jest.spyOn(Profiles.getInstance(), "getProfileInfo").mockResolvedValue({ mergeArgsForProfile: () => ({ knownArgs: [ @@ -1237,7 +1299,7 @@ describe("Profiles Unit Tests - function clearFilterFromAllTrees", () => { }); it("should fail to clear filter if no session nodes are available", async () => { - const globalMocks = await createGlobalMocks(); + const globalMocks = createGlobalMocks(); const testNode = new (ZoweTreeNode as any)( "fake", vscode.TreeItemCollapsibleState.None, @@ -1264,7 +1326,7 @@ describe("Profiles Unit Tests - function clearFilterFromAllTrees", () => { }); it("should fail to clear filters if the session node is not listed in the tree", async () => { - const globalMocks = await createGlobalMocks(); + const globalMocks = createGlobalMocks(); const testNode = new (ZoweTreeNode as any)( "fake", vscode.TreeItemCollapsibleState.None, @@ -1301,7 +1363,7 @@ describe("Profiles Unit Tests - function disableValidation", () => { }); it("should disable validation for the profile on all trees", async () => { - const globalMocks = await createGlobalMocks(); + const globalMocks = createGlobalMocks(); jest.spyOn(SharedTreeProviders, "getSessionForAllTrees").mockReturnValue([globalMocks.testNode]); expect(globalMocks.testNode.contextValue).toEqual(Constants.DS_SESSION_CONTEXT); expect(Profiles.getInstance().disableValidation(globalMocks.testNode)).toEqual(globalMocks.testNode); @@ -1309,7 +1371,7 @@ describe("Profiles Unit Tests - function disableValidation", () => { }); it("should disable validation for the profile on the current tree", async () => { - const globalMocks = await createGlobalMocks(); + const globalMocks = createGlobalMocks(); jest.spyOn(SharedTreeProviders, "getSessionForAllTrees").mockReturnValue([globalMocks.testNode]); const disableValidationContextSpy = jest.spyOn(Profiles.getInstance(), "disableValidationContext"); expect(globalMocks.testNode.contextValue).toEqual(Constants.DS_SESSION_CONTEXT); @@ -1327,7 +1389,7 @@ describe("Profiles Unit Tests - function enableValidation", () => { }); it("should enable validation for the profile on all trees", async () => { - const globalMocks = await createGlobalMocks(); + const globalMocks = createGlobalMocks(); jest.spyOn(SharedTreeProviders, "getSessionForAllTrees").mockReturnValue([ createMockNode("test2", Constants.DS_SESSION_CONTEXT), globalMocks.testNode, @@ -1338,7 +1400,7 @@ describe("Profiles Unit Tests - function enableValidation", () => { }); it("should enable validation for the profile on the current tree", async () => { - const globalMocks = await createGlobalMocks(); + const globalMocks = createGlobalMocks(); const enableValidationContextSpy = jest.spyOn(Profiles.getInstance(), "enableValidationContext"); jest.spyOn(SharedTreeProviders, "getSessionForAllTrees").mockReturnValue([globalMocks.testNode]); expect(globalMocks.testNode.contextValue).toEqual(Constants.DS_SESSION_CONTEXT); diff --git a/packages/zowe-explorer/src/configuration/Profiles.ts b/packages/zowe-explorer/src/configuration/Profiles.ts index 980c594f5a..015dad6a42 100644 --- a/packages/zowe-explorer/src/configuration/Profiles.ts +++ b/packages/zowe-explorer/src/configuration/Profiles.ts @@ -473,7 +473,7 @@ export class Profiles extends ProfilesCache { profiles: [...this.getCoreProfileTypes(), ProfileConstants.BaseProfile], baseProfile: ProfileConstants.BaseProfile, }; - const newConfig: imperative.IConfig = await imperative.ConfigBuilder.build(impConfig, opts); + const newConfig: imperative.IConfig = await imperative.ConfigBuilder.build(impConfig, global, opts); // Create non secure profile if VS Code setting is false this.createNonSecureProfile(newConfig); From 2bc4a7723feb79dfa1ff5c45bcc07b3d1ff51756 Mon Sep 17 00:00:00 2001 From: "Andrew W. Harn" Date: Thu, 25 Jul 2024 10:10:00 -0400 Subject: [PATCH 2/4] Update changelog Signed-off-by: Andrew W. Harn --- packages/zowe-explorer/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/zowe-explorer/CHANGELOG.md b/packages/zowe-explorer/CHANGELOG.md index b6a5a7f03a..53e4d4ac64 100644 --- a/packages/zowe-explorer/CHANGELOG.md +++ b/packages/zowe-explorer/CHANGELOG.md @@ -43,6 +43,7 @@ All notable changes to the "vscode-extension-for-zowe" extension will be documen - **Breaking:** Zowe Explorer no longer uses a temporary directory for storing Data Sets and USS files. All settings related to the temporary downloads folder have been removed. In order to access resources stored by Zowe Explorer v3, refer to the [FileSystemProvider documentation](https://github.com/zowe/zowe-explorer-vscode/wiki/FileSystemProvider) for information on how to build and access resource URIs. Extenders can detect changes to resources using the `onResourceChanged` function in the `ZoweExplorerApiRegister` class. [#2951](https://github.com/zowe/zowe-explorer-vscode/issues/2951) - Implemented the `onVaultUpdate` VSCode events to notify extenders when credentials are updated on the OS vault by other applications. [#2994](https://github.com/zowe/zowe-explorer-vscode/pull/2994) - Implemented the `onCredMgrsUpdate` VSCode events to notify extenders when the local PC's credential manager has been updated by other applications. [#2994](https://github.com/zowe/zowe-explorer-vscode/pull/2994) +- Changed default base profile naming scheme in newly generated configuration files to prevent name and property collisions between Global and Project profiles [#2682](https://github.com/zowe/zowe-explorer-vscode/issues/2682) ### Bug fixes From 0b63010efa0df4ae19f233b90c175b525d9c9111 Mon Sep 17 00:00:00 2001 From: "Andrew W. Harn" Date: Thu, 25 Jul 2024 10:35:13 -0400 Subject: [PATCH 3/4] Move workspace folder mock to the test it is needed Signed-off-by: Andrew W. Harn --- .../__tests__/__unit__/configuration/Profiles.unit.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/zowe-explorer/__tests__/__unit__/configuration/Profiles.unit.test.ts b/packages/zowe-explorer/__tests__/__unit__/configuration/Profiles.unit.test.ts index fb775763d4..187c93c61f 100644 --- a/packages/zowe-explorer/__tests__/__unit__/configuration/Profiles.unit.test.ts +++ b/packages/zowe-explorer/__tests__/__unit__/configuration/Profiles.unit.test.ts @@ -402,7 +402,6 @@ describe("Profiles Unit Tests - Function editZoweConfigFile", () => { }); describe("Profiles Unit Tests - Function createZoweSchema", () => { - const mockWorkspaceFolders = jest.fn(); function createBlockMocks(globalMocks) { const newMocks = { session: createISessionWithoutCredentials(), @@ -582,6 +581,7 @@ describe("Profiles Unit Tests - Function createZoweSchema", () => { }); it("Test that createZoweSchema will create local configuration", async () => { + const mockWorkspaceFolders = jest.fn(); const globalMocks = createGlobalMocks(); const blockMocks = createBlockMocks(globalMocks); Object.defineProperty(vscode.workspace, "workspaceFolders", { From 7cbcf89c14ef2c194c05a847b4e98e839f46ea6d Mon Sep 17 00:00:00 2001 From: "Andrew W. Harn" Date: Fri, 26 Jul 2024 08:18:47 -0400 Subject: [PATCH 4/4] Collision to Conflict Signed-off-by: Andrew W. Harn --- packages/zowe-explorer/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/zowe-explorer/CHANGELOG.md b/packages/zowe-explorer/CHANGELOG.md index 53e4d4ac64..e8b4ff977a 100644 --- a/packages/zowe-explorer/CHANGELOG.md +++ b/packages/zowe-explorer/CHANGELOG.md @@ -43,7 +43,7 @@ All notable changes to the "vscode-extension-for-zowe" extension will be documen - **Breaking:** Zowe Explorer no longer uses a temporary directory for storing Data Sets and USS files. All settings related to the temporary downloads folder have been removed. In order to access resources stored by Zowe Explorer v3, refer to the [FileSystemProvider documentation](https://github.com/zowe/zowe-explorer-vscode/wiki/FileSystemProvider) for information on how to build and access resource URIs. Extenders can detect changes to resources using the `onResourceChanged` function in the `ZoweExplorerApiRegister` class. [#2951](https://github.com/zowe/zowe-explorer-vscode/issues/2951) - Implemented the `onVaultUpdate` VSCode events to notify extenders when credentials are updated on the OS vault by other applications. [#2994](https://github.com/zowe/zowe-explorer-vscode/pull/2994) - Implemented the `onCredMgrsUpdate` VSCode events to notify extenders when the local PC's credential manager has been updated by other applications. [#2994](https://github.com/zowe/zowe-explorer-vscode/pull/2994) -- Changed default base profile naming scheme in newly generated configuration files to prevent name and property collisions between Global and Project profiles [#2682](https://github.com/zowe/zowe-explorer-vscode/issues/2682) +- Changed default base profile naming scheme in newly generated configuration files to prevent name and property conflicts between Global and Project profiles [#2682](https://github.com/zowe/zowe-explorer-vscode/issues/2682) ### Bug fixes