Files
stack/apps/web/src/app/(auth)/login/page.test.tsx
T
jason.woltjeandClaude Sonnet 4.5 ac1f2c176f fix: Resolve all ESLint errors and warnings in web package
Fixes all 542 ESLint problems in the web package to achieve 0 errors and 0 warnings.

Changes:
- Fixed 144 issues: nullish coalescing, return types, unused variables
- Fixed 118 issues: unnecessary conditions, type safety, template literals
- Fixed 79 issues: non-null assertions, unsafe assignments, empty functions
- Fixed 67 issues: explicit return types, promise handling, enum comparisons
- Fixed 45 final warnings: missing return types, optional chains
- Fixed 25 typecheck-related issues: async/await, type assertions, formatting
- Fixed JSX.Element namespace errors across 90+ files

All Quality Rails violations resolved. Lint and typecheck both pass with 0 problems.

Files modified: 118 components, tests, hooks, and utilities

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
2026-01-31 00:10:03 -06:00

38 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: ReturnType<typeof vi.fn> } => ({
push: vi.fn(),
}),
}));
describe("LoginPage", (): void => {
it("should render the login page with title", (): void => {
render(<LoginPage />);
expect(screen.getByRole("heading", { level: 1 })).toHaveTextContent("Welcome to Mosaic Stack");
});
it("should display the description", (): void => {
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", (): void => {
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", (): void => {
const { container } = render(<LoginPage />);
const main = container.querySelector("main");
expect(main).toHaveClass("flex", "min-h-screen");
});
});