Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"editor.tabSize": 2
}
"editor.tabSize": 2,
"sarif-viewer.connectToGithubCodeScanning": "off"
}
4 changes: 2 additions & 2 deletions nuget.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
"packages": [
{
"name": "Microsoft.PowerApps.CLI",
"version": "1.31.6",
"version": "1.32.8",
"internalName": "pac"
},
{
"name": "Microsoft.PowerApps.CLI.Core.linux-x64",
"version": "1.31.6",
"version": "1.32.8",
"internalName": "pac_linux",
"chmod": "tools/pac"
}
Expand Down
4 changes: 3 additions & 1 deletion src/actions/installCatalog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ export interface InstallCatalogParameters extends CommonActionParameters {
credentials: AuthCredentials;
environmentUrl: string;
catalogItemId: HostParameterEntry;
targetEnvironmentUrl: HostParameterEntry;
targetEnvironmentUrl?: HostParameterEntry;
targetEnvironment?: HostParameterEntry;
targetVersion?: HostParameterEntry;
settings?: HostParameterEntry;
pollStatus?: HostParameterEntry;
Expand All @@ -28,6 +29,7 @@ export async function installCatalog(parameters: InstallCatalogParameters, runne

validator.pushInput(pacArgs, "--catalog-item-id", parameters.catalogItemId);
validator.pushInput(pacArgs, "--target-url", parameters.targetEnvironmentUrl);
validator.pushInput(pacArgs, "--target-env", parameters.targetEnvironment);
validator.pushInput(pacArgs, "--settings", parameters.settings);
validator.pushInput(pacArgs, "--target-version", parameters.targetVersion);
validator.pushInput(pacArgs, "--poll-status", parameters.pollStatus);
Expand Down
11 changes: 10 additions & 1 deletion test/actions/installCatalog.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,18 +52,27 @@ describe("action: install catalog", () => {
credentials: mockClientCredentials,
environmentUrl: environmentUrl,
catalogItemId: { name: "CatalogItemId", required: true },
targetEnvironmentUrl: { name: "TargetEnvironmentUrl", required: true },
settings: { name: "Settings", required: false },
targetVersion: { name: "TargetVersion", required: false },
pollStatus: { name: "PollStatus", required: false },
logToConsole: false
});

it("with required params, calls pac runner with correct args", async () => {
installCatalogParameters.targetEnvironmentUrl = { name: "TargetEnvironmentUrl", required: true };
await runActionWithMocks(installCatalogParameters);

authenticateEnvironmentStub.should.have.been.calledOnceWith(pacStub, mockClientCredentials);
pacStub.should.have.been.calledOnceWith("catalog", "install", "--catalog-item-id", mockedHost.catalogItemId, "--target-url", mockedHost.targetEnvironmentUrl);
clearAuthenticationStub.should.have.been.calledOnceWith(pacStub);
});

it("with required params, calls pac runner with correct args 2", async () => {
installCatalogParameters.targetEnvironment = { name: "TargetEnvironment", required: true };
await runActionWithMocks(installCatalogParameters);

authenticateEnvironmentStub.should.have.been.calledOnceWith(pacStub, mockClientCredentials);
pacStub.should.have.been.calledOnceWith("catalog", "install", "--catalog-item-id", mockedHost.catalogItemId, "--target-env", mockedHost.targetEnvironment);
clearAuthenticationStub.should.have.been.calledOnceWith(pacStub);
});
});