Add lens:// protocol handling with a routing mechanism

- document the methods in an extension guide

- add integration test to make sure that all tested OSes work as
  intended

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton committed 2021-02-02 08:48:01 -05:00
1 parent 21adda2c64
commit 8430b67d55
23 files changed
+983 -106

No files matched your search

+12
View File
@@ -2,6 +2,7 @@ import { Application } from "spectron";
import * as utils from "../helpers/utils";
import { listHelmRepositories } from "../helpers/utils";
import { fail } from "assert";
import open from "open";
jest.setTimeout(60000);
@@ -28,6 +29,17 @@ describe("Lens integration tests", () => {
await app.client.waitUntilTextExists("h2", "Add Cluster");
});
describe("protocol app start", () => {
it ("should handle opening lens:// links", async () => {
await open("lens://internal/foobar?");
await new Promise(resolve => setTimeout(resolve, 5000));
const logs = await app.client.getMainProcessLogs();
expect(logs.some(log => log.includes("no handler") || log.includes("lens://internal/foobar?"))).toBe(true);
});
});
describe("preferences page", () => {
it('shows "preferences"', async () => {
const appName: string = process.platform === "darwin" ? "Lens" : "File";