- 新增 jsdom + @testing-library/react 组件测试环境 - 新增 12 个组件测试,覆盖所有前端组件 - 补充后端 middleware 和 helpers 单元测试 - 删除伪测试 use-target-detail-logic.test.ts - 精简过度枚举的 color-threshold.test.ts - 新增 bunfig.toml 配置测试 preload - 更新 DEVELOPMENT.md 测试章节 - 安装 @types/jsdom 修复类型声明
18 lines
546 B
TypeScript
18 lines
546 B
TypeScript
import "../../../tests/web/test-utils";
|
|
import { render } from "@testing-library/react";
|
|
import { describe, expect, test } from "bun:test";
|
|
|
|
import { StatusDot } from "../../../src/web/components/StatusDot";
|
|
|
|
describe("StatusDot", () => {
|
|
test("up=true 不崩溃", () => {
|
|
const { container } = render(<StatusDot up={true} />);
|
|
expect(container.firstChild).not.toBeNull();
|
|
});
|
|
|
|
test("up=false 不崩溃", () => {
|
|
const { container } = render(<StatusDot up={false} />);
|
|
expect(container.firstChild).not.toBeNull();
|
|
});
|
|
});
|