From 9a65d1b73be2a447b5f3ea1b4b18d12863cdf4c3 Mon Sep 17 00:00:00 2001 From: Jari Kolehmainen Date: Tue, 27 Apr 2021 10:30:43 +0300 Subject: [PATCH] fix integration tests Signed-off-by: Jari Kolehmainen --- integration/__tests__/app.tests.ts | 4 ---- integration/__tests__/cluster-pages.tests.ts | 2 -- integration/__tests__/command-palette.tests.ts | 1 - integration/helpers/utils.ts | 18 ++++-------------- src/renderer/components/+catalog/catalog.tsx | 10 ---------- .../components/cluster-manager/bottom-bar.tsx | 2 +- 6 files changed, 5 insertions(+), 32 deletions(-) diff --git a/integration/__tests__/app.tests.ts b/integration/__tests__/app.tests.ts index fa1f4ef286..5f0fe9df04 100644 --- a/integration/__tests__/app.tests.ts +++ b/integration/__tests__/app.tests.ts @@ -30,10 +30,6 @@ describe("Lens integration tests", () => { } }); - it('shows "whats new"', async () => { - await utils.clickWhatsNew(app); - }); - it('shows "add cluster"', async () => { await app.electron.ipcRenderer.send("test-menu-item-click", "File", "Add Cluster"); await app.client.waitUntilTextExists("h2", "Add Clusters from Kubeconfig"); diff --git a/integration/__tests__/cluster-pages.tests.ts b/integration/__tests__/cluster-pages.tests.ts index 00c5a7cdc8..7e88c77608 100644 --- a/integration/__tests__/cluster-pages.tests.ts +++ b/integration/__tests__/cluster-pages.tests.ts @@ -24,8 +24,6 @@ describe("Lens cluster pages", () => { utils.describeIf(ready)("test common pages", () => { let clusterAdded = false; const addCluster = async () => { - await utils.clickWhatsNew(app); - await utils.clickWelcomeNotification(app); await app.client.waitUntilTextExists("div", "Catalog"); await addMinikubeCluster(app); await waitForMinikubeDashboard(app); diff --git a/integration/__tests__/command-palette.tests.ts b/integration/__tests__/command-palette.tests.ts index 08da064bd2..6f924f5524 100644 --- a/integration/__tests__/command-palette.tests.ts +++ b/integration/__tests__/command-palette.tests.ts @@ -18,7 +18,6 @@ describe("Lens command palette", () => { }); it("opens command dialog from menu", async () => { - await utils.clickWhatsNew(app); 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"); diff --git a/integration/helpers/utils.ts b/integration/helpers/utils.ts index e0862e1d36..bb41e65bdd 100644 --- a/integration/helpers/utils.ts +++ b/integration/helpers/utils.ts @@ -73,24 +73,14 @@ export async function appStart() { while (await app.client.getWindowCount() > 1); await app.client.windowByIndex(0); await app.client.waitUntilWindowLoaded(); + await showCatalog(app); return app; } -export async function clickWhatsNew(app: Application) { - await app.client.waitUntilTextExists("h1", "What's new?"); - await app.client.click("button.primary"); - await app.client.waitUntilTextExists("div", "Catalog"); -} - -export async function clickWelcomeNotification(app: Application) { - const itemsText = await app.client.$("div.info-panel").getText(); - - if (itemsText === "0 items") { - // welcome notification should be present, dismiss it - await app.client.waitUntilTextExists("div.message", "Welcome!"); - await app.client.click(".notification i.Icon.close"); - } +export async function showCatalog(app: Application) { + await app.client.waitUntilTextExists("[data-test-id=catalog-link]", "Catalog"); + await app.client.click("[data-test-id=catalog-link]"); } type AsyncPidGetter = () => Promise; diff --git a/src/renderer/components/+catalog/catalog.tsx b/src/renderer/components/+catalog/catalog.tsx index 54e6cc21f2..b04a83e9c6 100644 --- a/src/renderer/components/+catalog/catalog.tsx +++ b/src/renderer/components/+catalog/catalog.tsx @@ -13,7 +13,6 @@ import { CatalogEntityContextMenu, CatalogEntityContextMenuContext, catalogEntit import { Badge } from "../badge"; import { HotbarStore } from "../../../common/hotbar-store"; import { autobind } from "../../utils"; -import { Notifications } from "../notifications"; import { ConfirmDialog } from "../confirm-dialog"; import { Tab, Tabs } from "../tabs"; import { catalogCategoryRegistry } from "../../../common/catalog"; @@ -45,15 +44,6 @@ export class Catalog extends React.Component { } }, { fireImmediately: true }) ]); - - setTimeout(() => { - if (this.catalogEntityStore.items.length === 0) { - Notifications.info(<>Welcome!

Get started by associating one or more clusters to Lens

, { - timeout: 30_000, - id: "catalog-welcome" - }); - } - }, 2_000); } addToHotbar(item: CatalogEntityItem) { diff --git a/src/renderer/components/cluster-manager/bottom-bar.tsx b/src/renderer/components/cluster-manager/bottom-bar.tsx index eb82fdb6b2..aadb50a1aa 100644 --- a/src/renderer/components/cluster-manager/bottom-bar.tsx +++ b/src/renderer/components/cluster-manager/bottom-bar.tsx @@ -48,7 +48,7 @@ export class BottomBar extends React.Component {
{this.renderRegisteredItems()}