Skip to content

Commit

Permalink
add some component tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tsirysndr committed Jun 20, 2024
1 parent 30ebe1e commit 3d7970c
Show file tree
Hide file tree
Showing 15 changed files with 11,567 additions and 188 deletions.
3 changes: 2 additions & 1 deletion webui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
"storybook": "storybook dev -p 6006",
"build-storybook": "storybook build",
"graphql:generate": "graphql-codegen --config codegen.yml",
"test": "vitest --config vite.dev.config.ts"
"test": "vitest --config vite.dev.config.ts",
"coverage": "vitest run --config vite.dev.config.ts --coverage"
},
"dependencies": {
"@apollo/client": "^3.9.4",
Expand Down
2 changes: 1 addition & 1 deletion webui/src/Components/Header/Header.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ describe("Header", () => {
const { container } = render(
<Header
id="1"
onRun={() => {}}
onRun={vi.fn()}
breadcrumbs={[
{ title: "Projects", link: "/" },
{
Expand Down
10 changes: 10 additions & 0 deletions webui/src/Components/LogsViewer/LogsViewer.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { render } from "@testing-library/react";
import LogsViewer from "./LogsViewer";
import { logs } from "./mocks";

describe("LogsViewer", () => {
it("should render the component", () => {
const { container } = render(<LogsViewer logs={logs.split("\n")} />);
expect(container).toMatchSnapshot();
});
});
Loading

0 comments on commit 3d7970c

Please sign in to comment.