1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00
lens/integration/__tests__/command-palette.tests.ts
Jari Kolehmainen 02568443fd add integration tests
Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
2021-01-25 19:18:28 +02:00

37 lines
1.1 KiB
TypeScript

import { Application } from "spectron";
import * as utils from "../helpers/utils";
import { isMac } from "../../src/common/vars";
jest.setTimeout(60000);
describe("Lens command palette", () => {
let app: Application;
describe("menu", () => {
beforeAll(async () => {
app = await utils.appStart();
await utils.clickWhatsNew(app);
}, 20000);
afterAll(async () => {
if (app?.isRunning()) {
await utils.tearDown(app);
}
});
it("opens command dialog from menu", async () => {
await app.electron.ipcRenderer.send("test-menu-item-click", "View", "Command Palette...");
await app.client.waitUntilTextExists(".Select__option", "Preferences: Open");
await app.client.keys("Escape");
});
utils.describeIf(!isMac)("Linux & Windows", () => {
it("opens command dialog via keyboard", async () => {
await app.client.keys(["Control", "Shift", "p"]);
await app.client.waitUntilTextExists(".Select__option", "Preferences: Open");
await app.client.keys("Escape");
});
});
});
});