Skip to content

Commit

Permalink
fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
devkeydet committed Jun 7, 2024
1 parent 8e9e5c2 commit a54d415
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 19 deletions.
20 changes: 10 additions & 10 deletions nuget.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,28 @@
"name": "nuget.org",
"url": "https://api.nuget.org/v3-flatcontainer/",
"authenticated": false,
"packages": [
]
},
{
"name": "CAP_ISVExp_Tools_Stable",
"url": "https://pkgs.dev.azure.com/msazure/_packaging/b0441cf8-0bc8-4fad-b126-841a6184e784/nuget/v3/flat2/",
"authenticated": true,
"patEnvironmentVariable": "AZ_DevOps_Read_PAT",
"packages": [
{
"name": "Microsoft.PowerApps.CLI",
"version": "1.32.4",
"version": "1.32.8",
"internalName": "pac"
},
{
"name": "Microsoft.PowerApps.CLI.Core.linux-x64",
"version": "1.32.4",
"version": "1.32.8",
"internalName": "pac_linux",
"chmod": "tools/pac"
}
]
},
{
"name": "CAP_ISVExp_Tools_Stable",
"url": "https://pkgs.dev.azure.com/msazure/_packaging/b0441cf8-0bc8-4fad-b126-841a6184e784/nuget/v3/flat2/",
"authenticated": true,
"patEnvironmentVariable": "AZ_DevOps_Read_PAT",
"packages": [
]
},
{
"name": "CAP_ISVExp_Tools_Daily",
"url": "https://pkgs.dev.azure.com/msazure/_packaging/d3fb5788-d047-47f9-9aba-76890f5cecf0/nuget/v3/flat2/",
Expand Down
2 changes: 1 addition & 1 deletion src/actions/installCatalog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export interface InstallCatalogParameters extends CommonActionParameters {
environmentUrl: string;
catalogItemId: HostParameterEntry;
targetEnvironmentUrl?: HostParameterEntry;
targetEnvironment: HostParameterEntry;
targetEnvironment?: HostParameterEntry;
targetVersion?: HostParameterEntry;
settings?: HostParameterEntry;
pollStatus?: HostParameterEntry;
Expand Down
15 changes: 7 additions & 8 deletions test/actions/installCatalog.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,21 +52,20 @@ describe("action: install catalog", () => {
credentials: mockClientCredentials,
environmentUrl: environmentUrl,
catalogItemId: { name: "CatalogItemId", required: true },
targetEnvironmentUrl: { name: "TargetEnvironmentUrl", required: true },
targetEnvironment: { name: "TargetEnvironment", 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 () => {
// await runActionWithMocks(installCatalogParameters);
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);
// });
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 };
Expand Down

0 comments on commit a54d415

Please sign in to comment.