mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
* Fix shouldShowResource when not a cluster admin Signed-off-by: Sebastian Malton <sebastian@malton.name> * Fix only tests that rely on bad formatting of resources Signed-off-by: Sebastian Malton <sebastian@malton.name> Signed-off-by: Sebastian Malton <sebastian@malton.name>
41 lines
1.4 KiB
TypeScript
41 lines
1.4 KiB
TypeScript
/**
|
|
* Copyright (c) OpenLens Authors. All rights reserved.
|
|
* Licensed under MIT License. See LICENSE in root directory for more information.
|
|
*/
|
|
|
|
import type { RenderResult } from "@testing-library/react";
|
|
import navigateToWorkloadsOverviewInjectable from "../../common/front-end-routing/routes/cluster/workloads/overview/navigate-to-workloads-overview.injectable";
|
|
import { type ApplicationBuilder, getApplicationBuilder } from "../../renderer/components/test-utils/get-application-builder";
|
|
|
|
describe("workload overview", () => {
|
|
let rendered: RenderResult;
|
|
let applicationBuilder: ApplicationBuilder;
|
|
|
|
beforeEach(async () => {
|
|
applicationBuilder = getApplicationBuilder().setEnvironmentToClusterFrame();
|
|
applicationBuilder.allowKubeResource({
|
|
apiName: "pods",
|
|
group: "",
|
|
});
|
|
rendered = await applicationBuilder.render();
|
|
});
|
|
|
|
describe("when navigating to workload overview", () => {
|
|
beforeEach(() => {
|
|
applicationBuilder.navigateWith(navigateToWorkloadsOverviewInjectable);
|
|
});
|
|
|
|
it("renders", () => {
|
|
expect(rendered.baseElement).toMatchSnapshot();
|
|
});
|
|
|
|
it("shows workload overview", () => {
|
|
expect(rendered.queryByTestId("page-for-workloads-overview")).toBeInTheDocument();
|
|
});
|
|
|
|
it("shows pods pie chart", () => {
|
|
expect(rendered.queryByTestId("workload-overview-status-chart-pods")).toBeInTheDocument();
|
|
});
|
|
});
|
|
});
|