-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(3.0.3): Prompt in editor for 401 error, fix profile propagation (#…
…3318) * fix: profile change propagation, prompt on auth error Signed-off-by: Trae Yelovich <[email protected]> * tests: profile propagation, tree node cases Signed-off-by: Trae Yelovich <[email protected]> * chore: changelogs Signed-off-by: Trae Yelovich <[email protected]> * test(jobs): add patch coverage Signed-off-by: Trae Yelovich <[email protected]> * tests: AuthUtils.promptForAuthError Signed-off-by: Trae Yelovich <[email protected]> * tests: UssFSProvider.fetchFileAtUri Signed-off-by: Trae Yelovich <[email protected]> * fix: reset wasAccessed flag if ImperativeError caught Signed-off-by: Trae Yelovich <[email protected]> * tests: resolve failing USS tests Signed-off-by: Trae Yelovich <[email protected]> * fix failing jobs test Signed-off-by: Trae Yelovich <[email protected]> --------- Signed-off-by: Trae Yelovich <[email protected]>
- Loading branch information
Showing
16 changed files
with
286 additions
and
145 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
packages/zowe-explorer/__tests__/__unit__/utils/AuthUtils.unit.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/** | ||
* This program and the accompanying materials are made available under the terms of the | ||
* Eclipse Public License v2.0 which accompanies this distribution, and is available at | ||
* https://www.eclipse.org/legal/epl-v20.html | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Copyright Contributors to the Zowe Project. | ||
* | ||
*/ | ||
|
||
import { imperative } from "@zowe/zowe-explorer-api"; | ||
import { AuthUtils } from "../../../src/utils/AuthUtils"; | ||
|
||
describe("AuthUtils", () => { | ||
describe("promptForAuthError", () => { | ||
it("should prompt for authentication", async () => { | ||
const errorDetails = new imperative.ImperativeError({ | ||
errorCode: 401 as unknown as string, | ||
msg: "All configured authentication methods failed", | ||
}); | ||
const profile = { type: "zosmf" } as any; | ||
const promptForAuthenticationMock = jest | ||
.spyOn(AuthUtils, "promptForAuthentication") | ||
.mockImplementation(async () => Promise.resolve(true)); | ||
AuthUtils.promptForAuthError(errorDetails, profile); | ||
expect(promptForAuthenticationMock).toHaveBeenCalledWith(errorDetails, profile); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.