mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Adding workspace switch tests
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
parent
7ea7ee7a85
commit
b8abaf86d9
@ -55,7 +55,7 @@ describe("Lens integration tests", () => {
|
||||
|
||||
describe("preferences page", () => {
|
||||
it('shows "preferences"', async () => {
|
||||
let appName: string = process.platform === "darwin" ? "Lens" : "File"
|
||||
const appName: string = process.platform === "darwin" ? "Lens" : "File"
|
||||
await app.electron.ipcRenderer.send('test-menu-item-click', appName, "Preferences")
|
||||
await app.client.waitUntilTextExists("h2", "Preferences")
|
||||
})
|
||||
@ -73,6 +73,41 @@ describe("Lens integration tests", () => {
|
||||
})
|
||||
})
|
||||
|
||||
describe("workspaces", () => {
|
||||
beforeAll(appStart, 20000)
|
||||
|
||||
afterAll(async () => {
|
||||
if (app && app.isRunning()) {
|
||||
return util.tearDown(app)
|
||||
}
|
||||
})
|
||||
|
||||
it('switches between workspaces', async () => {
|
||||
await clickWhatsNew(app)
|
||||
await app.client.click('#current-workspace .Icon')
|
||||
await app.client.click('a[href="/workspaces"]')
|
||||
await app.client.click('.Workspaces button.Button')
|
||||
await app.client.keys("test-workspace")
|
||||
await app.client.click('.Workspaces .Input.description input')
|
||||
await app.client.keys("test description")
|
||||
await app.client.click('.Workspaces .workspace.editing .Icon')
|
||||
await app.client.waitUntilTextExists(".workspace .name a", "test-workspace")
|
||||
await addMinikubeCluster(app)
|
||||
await app.client.waitForExist(`iframe[name="minikube"]`)
|
||||
await app.client.waitForVisible(".ClustersMenu .ClusterIcon.active")
|
||||
|
||||
// Go to test-workspace
|
||||
await app.client.click('#current-workspace .Icon')
|
||||
await app.client.click('.WorkspaceMenu li[title="test description"]')
|
||||
await addMinikubeCluster(app)
|
||||
|
||||
// Back to default one
|
||||
await app.client.click('#current-workspace .Icon')
|
||||
await app.client.click('.WorkspaceMenu > li:first-of-type')
|
||||
await app.client.waitForVisible(".ClustersMenu .ClusterIcon.active")
|
||||
})
|
||||
})
|
||||
|
||||
const minikubeReady = (): boolean => {
|
||||
// determine if minikube is running
|
||||
let status = spawnSync("minikube status", { shell: true })
|
||||
|
||||
@ -65,6 +65,7 @@ describe("empty config", () => {
|
||||
it("sets active cluster", () => {
|
||||
clusterStore.setActive("foo");
|
||||
expect(clusterStore.active.id).toBe("foo");
|
||||
expect(workspaceStore.currentWorkspace.lastActiveClusterId).toBe("foo");
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { WorkspaceId, workspaceStore } from "./workspace-store";
|
||||
import { workspaceStore } from "./workspace-store";
|
||||
import path from "path";
|
||||
import { app, ipcRenderer, remote, webFrame } from "electron";
|
||||
import { unlink } from "fs-extra";
|
||||
@ -13,6 +13,7 @@ import { saveToAppFiles } from "./utils/saveToAppFiles";
|
||||
import { KubeConfig } from "@kubernetes/client-node";
|
||||
import _ from "lodash";
|
||||
import move from "array-move";
|
||||
import type { WorkspaceId } from "./workspace-store";
|
||||
|
||||
export interface ClusterIconUpload {
|
||||
clusterId: string;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user