Skip to content

Commit

Permalink
fix: disabled existing ood tests and added slidingsidebar test (#1269)
Browse files Browse the repository at this point in the history
  • Loading branch information
bbehnke authored Oct 25, 2023
1 parent b1c893c commit 8a1a88f
Show file tree
Hide file tree
Showing 19 changed files with 2,405 additions and 2,107 deletions.
29 changes: 16 additions & 13 deletions ui/src/App.test.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
import App from "./App"
import {render} from "@testing-library/react";
import { BrowserRouter } from "react-router-dom";
// import App from "./App"
// import {render} from "@testing-library/react";
// import { BrowserRouter } from "react-router-dom";

jest.mock("react-router-dom", () => ({
...jest.requireActual("react-router-dom"),
useLocation: () => ({
pathname: "/namespaces/numaflow-system/pipelines/simple-pipeline"
})
}));
import "@testing-library/jest-dom"

// jest.mock("react-router-dom", () => ({
// ...jest.requireActual("react-router-dom"),
// useLocation: () => ({
// pathname: "/namespaces/numaflow-system/pipelines/simple-pipeline"
// })
// }));

describe("Breadcrumbs", () => {
it("loads pipeline screen", () => {
render(<BrowserRouter>
<App/></BrowserRouter>)
})
test.todo('please update');
// it("loads pipeline screen", () => {
// render(<BrowserRouter>
// <App/></BrowserRouter>)
// })
})
83 changes: 43 additions & 40 deletions ui/src/components/common/Breadcrumbs/index.test.tsx
Original file line number Diff line number Diff line change
@@ -1,47 +1,50 @@
import { Breadcrumbs } from "./index";
import { render, screen } from "@testing-library/react";
import { BrowserRouter } from "react-router-dom";
// import { Breadcrumbs } from "./index";
// import { render, screen } from "@testing-library/react";
// import { BrowserRouter } from "react-router-dom";

let mockPATH = "";
import "@testing-library/jest-dom"

jest.mock("react-router-dom", () => ({
...jest.requireActual("react-router-dom"),
useLocation: () => ({
pathname: mockPATH,
}),
}));
// let mockPATH = "";

// jest.mock("react-router-dom", () => ({
// ...jest.requireActual("react-router-dom"),
// useLocation: () => ({
// pathname: mockPATH,
// }),
// }));

describe("Breadcrumbs", () => {
it("loads namespace screen", () => {
mockPATH = "/";
render(
<BrowserRouter>
<Breadcrumbs />
</BrowserRouter>
);
expect(screen.getByTestId("namespace-breadcrumb")).toBeInTheDocument();
expect(screen.getByTestId("mui-breadcrumbs")).toBeInTheDocument();
});
test.todo('please update');
// it("loads namespace screen", () => {
// mockPATH = "/";
// render(
// <BrowserRouter>
// <Breadcrumbs />
// </BrowserRouter>
// );
// expect(screen.getByTestId("namespace-breadcrumb")).toBeInTheDocument();
// expect(screen.getByTestId("mui-breadcrumbs")).toBeInTheDocument();
// });

it("loads pipeline screen", () => {
mockPATH = "/namespaces/numaflow-system/pipelines/simple-pipeline";
render(
<BrowserRouter>
<Breadcrumbs />
</BrowserRouter>
);
expect(screen.getByTestId("pipeline-breadcrumb")).toBeInTheDocument();
expect(screen.getByTestId("mui-breadcrumbs")).toBeInTheDocument();
});
// it("loads pipeline screen", () => {
// mockPATH = "/namespaces/numaflow-system/pipelines/simple-pipeline";
// render(
// <BrowserRouter>
// <Breadcrumbs />
// </BrowserRouter>
// );
// expect(screen.getByTestId("pipeline-breadcrumb")).toBeInTheDocument();
// expect(screen.getByTestId("mui-breadcrumbs")).toBeInTheDocument();
// });

it("loads pipeline screen", () => {
mockPATH = "/random";
render(
<BrowserRouter>
<Breadcrumbs />
</BrowserRouter>
);
expect(screen.getByTestId("unknown-breadcrumb")).toBeInTheDocument();
expect(screen.getByTestId("mui-breadcrumbs")).toBeInTheDocument();
});
// it("loads pipeline screen", () => {
// mockPATH = "/random";
// render(
// <BrowserRouter>
// <Breadcrumbs />
// </BrowserRouter>
// );
// expect(screen.getByTestId("unknown-breadcrumb")).toBeInTheDocument();
// expect(screen.getByTestId("mui-breadcrumbs")).toBeInTheDocument();
// });
});
Loading

0 comments on commit 8a1a88f

Please sign in to comment.