mirror of
https://github.com/Zproger/Aurum.git
synced 2026-10-12 18:46:40 +07:00
backend/tests/: 33 pytest tests against a real Postgres database (aurum_test, created/migrated/dropped per run) exercised through the actual HTTP API — not sqlite, not mocks, and the real `aurum` database is never opened (app lifespan is skipped, get_session is overridden per test). Covers transaction category-kind validation, year/month/date-range filtering and pagination, dashboard summary arithmetic, budget status, cash flow, and the /transactions/years picker. e2e/: 6 Playwright specs driving a real browser against a fully separate throwaway docker-compose stack (run.sh: separate project name, database, port, and volume, torn down with `down -v` on exit) — regression coverage for the Recent Transactions month bug, the Card grid-overflow bug, the frozen-year bug, the Net Worth default range, and the Dashboard-> Transactions deep link, all fixed earlier this session. Also synced the backend's APP_VERSION constant (stale at 0.15.2, embedded in exported backups) with the frontend version.
20 lines
937 B
TypeScript
20 lines
937 B
TypeScript
import { test, expect } from "@playwright/test";
|
|
|
|
// Regression for v0.17.1: Net Worth defaulted to a 30-day window, which
|
|
// frequently shows a dip just from short-window noise even when the
|
|
// long-run trend is a climb — demotivating for no good reason. Should
|
|
// default to 5 years instead. See UPDATES.md (v0.17.1) and
|
|
// frontend/src/pages/NetWorthPage.tsx.
|
|
test("Net Worth opens with the 5Y range active, not 30D", async ({ page }) => {
|
|
await page.goto("/net-worth");
|
|
|
|
const fiveYearButton = page.getByRole("button", { name: "5Y", exact: true });
|
|
const thirtyDayButton = page.getByRole("button", { name: "30D", exact: true });
|
|
await expect(fiveYearButton).toBeVisible();
|
|
|
|
const fiveYearClass = await fiveYearButton.getAttribute("class");
|
|
const thirtyDayClass = await thirtyDayButton.getAttribute("class");
|
|
expect(fiveYearClass).toContain("bg-surface-2");
|
|
expect(thirtyDayClass).not.toContain("bg-surface-2");
|
|
});
|