Skip to content

Commit 7a8821d

Browse files
committed
Update tests
1 parent ca68c45 commit 7a8821d

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

lib/src/react/particles/particles.test.tsx

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,17 @@ import { cleanup, render, screen } from "@testing-library/react";
22
import { afterEach, describe, test } from "vitest";
33
import { Particles } from "./particles";
44

5-
describe.concurrent("particles", () => {
6-
afterEach(cleanup);
5+
describe("particles", () => {
6+
afterEach(cleanup);
77

8-
test("Dummy test - test if renders without errors", ({ expect }) => {
9-
const clx = "my-class";
10-
render(<Particles className={clx} />);
11-
expect(screen.getByTestId("particles").classList).toContain(clx);
12-
});
8+
test("Test if renders without errors", ({ expect }) => {
9+
const clx = "my-class";
10+
render(<Particles className={clx} />);
11+
expect(screen.getByTestId("particles").classList).toContain(clx);
12+
});
13+
14+
test("Test fullScreen overlay mode", ({ expect }) => {
15+
render(<Particles fullScreenOverlay />);
16+
expect(screen.getByTestId("particles").style.width).toBe("100vw");
17+
});
1318
});

lib/src/react/particles/particles.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ export const Particles = ({ options, overlay, fullScreenOverlay, ...props }: Par
3434
() =>
3535
canvasRef.current
3636
? renderParticles(canvasRef.current, { ...options, overlay: resolvedOverlay })
37-
: undefined,
37+
: /* v8 ignore next */
38+
undefined,
3839
[options, resolvedOverlay],
3940
);
4041
return <canvas ref={canvasRef} style={style} {...props} data-testid="particles" />;

0 commit comments

Comments
 (0)