test: cover glances widget internal modules

This commit is contained in:
shamoon
2026-02-04 10:37:58 -08:00
parent 0b332f95f4
commit 85116bfb02
16 changed files with 402 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
// @vitest-environment jsdom
import { render, screen } from "@testing-library/react";
import { describe, expect, it } from "vitest";
import Block from "./block";
describe("widgets/glances/components/block", () => {
it("renders children with the given absolute position classes", () => {
render(
<Block position="top-1 left-2">
<div>hi</div>
</Block>,
);
const el = screen.getByText("hi").parentElement;
expect(el).toHaveClass("absolute");
expect(el).toHaveClass("top-1");
expect(el).toHaveClass("left-2");
});
});