Files
stack/apps/web/src/app/(auth)/login/page.test.tsx
Jason Woltje 973502f26e feat(#37-41): Add domains, ideas, relationships, agents, widgets schema
Schema additions for issues #37-41:

New models:
- Domain (#37): Life domains (work, marriage, homelab, etc.)
- Idea (#38): Brain dumps with pgvector embeddings
- Relationship (#39): Generic entity linking (blocks, depends_on)
- Agent (#40): ClawdBot agent tracking with metrics
- AgentSession (#40): Conversation session tracking
- WidgetDefinition (#41): HUD widget registry
- UserLayout (#41): Per-user dashboard configuration

Updated models:
- Task, Event, Project: Added domainId foreign key
- User, Workspace: Added new relations

New enums:
- IdeaStatus: CAPTURED, PROCESSING, ACTIONABLE, ARCHIVED, DISCARDED
- RelationshipType: BLOCKS, BLOCKED_BY, DEPENDS_ON, etc.
- AgentStatus: IDLE, WORKING, WAITING, ERROR, TERMINATED
- EntityType: Added IDEA, DOMAIN

Migration: 20260129182803_add_domains_ideas_agents_widgets
2026-01-29 12:29:21 -06:00

40 lines
1.2 KiB
TypeScript

import { describe, it, expect, vi } from "vitest";
import { render, screen } from "@testing-library/react";
import LoginPage from "./page";
// Mock next/navigation
vi.mock("next/navigation", () => ({
useRouter: () => ({
push: vi.fn(),
}),
}));
describe("LoginPage", () => {
it("should render the login page with title", () => {
render(<LoginPage />);
expect(screen.getByRole("heading", { level: 1 })).toHaveTextContent(
"Welcome to Mosaic Stack"
);
});
it("should display the description", () => {
render(<LoginPage />);
const descriptions = screen.getAllByText(/Your personal assistant platform/i);
expect(descriptions.length).toBeGreaterThan(0);
expect(descriptions[0]).toBeInTheDocument();
});
it("should render the sign in button", () => {
render(<LoginPage />);
const buttons = screen.getAllByRole("button", { name: /sign in/i });
expect(buttons.length).toBeGreaterThan(0);
expect(buttons[0]).toBeInTheDocument();
});
it("should have proper layout styling", () => {
const { container } = render(<LoginPage />);
const main = container.querySelector("main");
expect(main).toHaveClass("flex", "min-h-screen");
});
});