1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

add handling no repos to list from helm in integration test

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton 2021-01-25 08:44:39 -05:00
parent 79db7bbbe4
commit cd75ac826a

View File

@ -96,12 +96,20 @@ describe("Lens integration tests", () => {
}); });
it("ensures helm repos", async () => { it("ensures helm repos", async () => {
const { stdout: reposJson } = await promiseExec("helm repo list -o json"); try {
const repos = JSON.parse(reposJson); const { stdout: reposJson } = await promiseExec("helm repo list -o json");
const repos = JSON.parse(reposJson);
await app.client.waitUntilTextExists("div.repos #message-bitnami", repos[0].name); // wait for the helm-cli to fetch the repo(s) await app.client.waitUntilTextExists("div.repos #message-bitnami", repos[0].name); // wait for the helm-cli to fetch the repo(s)
await app.client.click("#HelmRepoSelect"); // click the repo select to activate the drop-down await app.client.click("#HelmRepoSelect"); // click the repo select to activate the drop-down
await app.client.waitUntilTextExists("div.Select__option", ""); // wait for at least one option to appear (any text) await app.client.waitUntilTextExists("div.Select__option", ""); // wait for at least one option to appear (any text)
} catch (err) {
expect(err.stderr).toContain("Error: no repositories to show"); // other errors should be
await app.client.waitUntilTextExists("div.repos #message-bitnami", "bitnami"); // if no repos in list then bitnami should be showed
await app.client.click("#HelmRepoSelect"); // click the repo select to activate the drop-down
await app.client.waitUntilTextExists("div.Select__option", ""); // wait for at least one option to appear (any text)
}
}); });
}); });