Files
xiaoxia-saas/apps/web/src/test/components/ui/Input.test.tsx
T
xiaoxia 5610ef9f1a
CI/CD Pipeline / Check if frontend-only change (push) Has been skipped
CI Build & Deploy Pipeline / Build Production API Image (push) Has been skipped
CI Build & Deploy Pipeline / Build Production Worker Image (push) Has been skipped
CI Build & Deploy Pipeline / Build Production Web Image (push) Has been skipped
CI Build & Deploy Pipeline / Deploy Production (push) Has been skipped
CI Build & Deploy Pipeline / Production Browser E2E (push) Has been skipped
CI/CD Pipeline / Frontend Unit Tests (push) Successful in 1m8s
CI Build & Deploy Pipeline / Build Staging Web Image (push) Successful in 1m31s
CI/CD Pipeline / Frontend Lint (push) Successful in 2m26s
CI/CD Pipeline / Validate Code Quality And Tests (push) Successful in 3m46s
CI/CD Pipeline / Unit Tests (push) Successful in 3m49s
CI/CD Pipeline / Integration Tests (push) Successful in 1m52s
CI Build & Deploy Pipeline / Build Staging API Image (push) Successful in 6m29s
CI Build & Deploy Pipeline / Build Staging Worker Image (push) Successful in 8m32s
CI Build & Deploy Pipeline / Deploy Staging (Watchtower auto-deploy) (push) Successful in 50s
CI Build & Deploy Pipeline / Staging E2E Tests (push) Failing after 1m21s
CI Build & Deploy Pipeline / Staging API Integration Tests (push) Successful in 3m11s
test: 前端单测覆盖率Phase1,行覆盖率0.84%→22.35% (#560)
Co-authored-by: xiaoxia <dev@xiaoxiajianji.com>
Co-committed-by: xiaoxia <dev@xiaoxiajianji.com>
2026-07-19 11:16:36 +08:00

21 lines
684 B
TypeScript

import { describe, expect, it } from "vitest"
import { render } from "@testing-library/react"
import Input from "@/components/ui/Input"
describe("Input", () => {
it("should render without crashing", () => {
const { container } = render(<Input placeholder="Enter text" />)
expect(container).toBeTruthy()
})
it("should render with defaultValue", () => {
const { container } = render(<Input defaultValue="hello" />)
expect(container.querySelector("input")).toBeTruthy()
})
it("should render disabled", () => {
const { container } = render(<Input disabled defaultValue="test" />)
expect(container.querySelector("input:disabled")).toBeTruthy()
})
})