mirror of
https://github.com/azure/login.git
synced 2026-06-05 22:47:06 +00:00
Added L0s
This commit is contained in:
parent
db750ed598
commit
b1b178e95a
1 changed files with 23 additions and 0 deletions
23
__tests__/PowerShell/Utilities/ScriptBuilder.test.ts
Normal file
23
__tests__/PowerShell/Utilities/ScriptBuilder.test.ts
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
import ScriptBuilder from "../../../src/PowerShell/Utilities/ScriptBuilder";
|
||||
import Constants from "../../../src/PowerShell/Constants";
|
||||
|
||||
describe("Getting AzLogin PS script" , () => {
|
||||
const scheme = Constants.ServicePrincipal;
|
||||
let args: any = {
|
||||
servicePrincipalId: "service-principal-id",
|
||||
servicePrincipalKey: "service-principal-key",
|
||||
environment: "environment",
|
||||
scopeLevel: Constants.Subscription
|
||||
}
|
||||
|
||||
test("PS script should not set context without passing subscriptionId", () => {
|
||||
const loginScript = new ScriptBuilder().getAzPSLoginScript(scheme, "tenant-id", args);
|
||||
expect(loginScript.includes("Set-AzContext -SubscriptionId")).toBeFalsy();
|
||||
});
|
||||
|
||||
test("PS script should set context after passing subscriptionId", () => {
|
||||
args["subscriptionId"] = "subscription-id";
|
||||
const loginScript = new ScriptBuilder().getAzPSLoginScript(scheme, "tenant-id", args);
|
||||
expect(loginScript.includes("Set-AzContext -SubscriptionId")).toBeTruthy();
|
||||
});
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue