mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
fix integration tests
Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
This commit is contained in:
parent
4311f75737
commit
9a65d1b73b
@ -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");
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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");
|
||||
|
||||
@ -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<number>;
|
||||
|
||||
@ -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(<><b>Welcome!</b><p>Get started by associating one or more clusters to Lens</p></>, {
|
||||
timeout: 30_000,
|
||||
id: "catalog-welcome"
|
||||
});
|
||||
}
|
||||
}, 2_000);
|
||||
}
|
||||
|
||||
addToHotbar(item: CatalogEntityItem) {
|
||||
|
||||
@ -48,7 +48,7 @@ export class BottomBar extends React.Component {
|
||||
<div className="BottomBar flex gaps">
|
||||
<div id="catalog-link" data-test-id="catalog-link" className="flex gaps align-center" onClick={() => navigate(catalogURL())}>
|
||||
<Icon smallest material="view_list"/>
|
||||
<span className="workspace-name" data-test-id="current-workspace-name">Catalog</span>
|
||||
<span className="catalog-link" data-test-id="catalog-link">Catalog</span>
|
||||
</div>
|
||||
{this.renderRegisteredItems()}
|
||||
</div>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user