Skip to content

Commit

Permalink
Increase unit test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
mayank1513 committed May 1, 2024
1 parent 9be488d commit def5393
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
16 changes: 16 additions & 0 deletions lib/src/hooks/use-loader.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { cleanup, render, renderHook, screen, act } from "@testing-library/react";
import { afterEach, describe, test } from "vitest";
import { LoaderContainer } from "../client";
import { useLoader } from "./use-loader";

describe.concurrent("loader-container", () => {
afterEach(cleanup);

test("Test hook", ({ expect }) => {
const { result } = renderHook(() => useLoader());
const { container } = render(<LoaderContainer />);
expect(container.childElementCount).toBe(0);
act(() => result.current.setLoading(true));
expect(container.childElementCount).toBe(1);
});
});
2 changes: 1 addition & 1 deletion lib/src/server/dots/dots2/dots2.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ describe.concurrent("dots2", () => {
afterEach(cleanup);

test("check if renders without errors", ({ expect }) => {
render(<Dots2 />);
render(<Dots2 dotRadius={25} />);
});
});

0 comments on commit def5393

Please sign in to comment.