feat(#1): Set up monorepo scaffold with pnpm workspaces + TurboRepo
Implements the foundational project structure including: - pnpm workspaces configuration - TurboRepo for build orchestration - NestJS 11.1.12 API (apps/api) - Next.js 16.1.6 web app (apps/web) - Shared packages (config, shared, ui) - TypeScript strict mode configuration - ESLint + Prettier setup - Vitest for unit testing (19 passing tests) Fixes #1 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
31
packages/ui/src/components/Button.test.tsx
Normal file
31
packages/ui/src/components/Button.test.tsx
Normal file
@@ -0,0 +1,31 @@
|
||||
import { describe, expect, it, afterEach } from "vitest";
|
||||
import { render, screen, cleanup } from "@testing-library/react";
|
||||
import { Button } from "./Button.js";
|
||||
|
||||
afterEach(() => {
|
||||
cleanup();
|
||||
});
|
||||
|
||||
describe("Button", () => {
|
||||
it("should render children", () => {
|
||||
render(<Button>Click me</Button>);
|
||||
expect(screen.getByRole("button")).toHaveTextContent("Click me");
|
||||
});
|
||||
|
||||
it("should apply variant styles", () => {
|
||||
render(<Button variant="danger">Delete</Button>);
|
||||
const button = screen.getByRole("button");
|
||||
expect(button.className).toContain("bg-red-600");
|
||||
});
|
||||
|
||||
it("should apply size styles", () => {
|
||||
render(<Button size="lg">Large Button</Button>);
|
||||
const button = screen.getByRole("button");
|
||||
expect(button.className).toContain("px-6");
|
||||
});
|
||||
|
||||
it("should pass through additional props", () => {
|
||||
render(<Button disabled>Disabled</Button>);
|
||||
expect(screen.getByRole("button")).toBeDisabled();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user