Skip to content

Commit

Permalink
should show environments for the selected org
Browse files Browse the repository at this point in the history
  • Loading branch information
meniRoy committed Sep 25, 2023
1 parent 85590ce commit 542b3d1
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/test/integration/suite/authentication.test.it.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,4 +105,21 @@ suite("authentication", function () {
)
);
});

test("should show environments for the selected org", async () => {
const secondOrg = { name: "second org", id: "second-org-id" };
const onQuickPick = spyOnQuickPick();
onQuickPick.mockImplementationOnce(() =>
Promise.resolve({ label: secondOrg.name, description: secondOrg.id })
);
mockGetOrganization([selectedOrg, secondOrg], auth);
mockGetEnvironment(secondOrg.id, [environmentMock], auth);
mockGitRepoAndBranch("main", "[email protected]:user/repo.git");
mockGetDeploymentStepsApiResponse();
await login(auth);

await waitFor(() =>
expect(getFirstEnvironment().name).toBe(environmentMock.name)
);
});
});

0 comments on commit 542b3d1

Please sign in to comment.