From 9c0d43b1ec8c6a08369d203d1aa1b37ff6006025 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leon=20Tonh=C3=A4user?= Date: Mon, 10 Aug 2026 21:51:25 +0200 Subject: [PATCH] test: add portal end-to-end quality gates --- .github/workflows/ci.yml | 89 ++++++++++ e2e/billing.spec.ts | 8 + e2e/download.spec.ts | 9 + e2e/fixtures.ts | 34 ++++ e2e/registration.spec.ts | 21 +++ package.json | 1 + playwright.config.ts | 27 +++ pnpm-lock.yaml | 281 +++++++++++++++++-------------- tests/fake-immich/server.test.ts | 48 ++++++ tests/fake-immich/server.ts | 214 +++++++++++++++++++++++ 10 files changed, 609 insertions(+), 123 deletions(-) create mode 100644 .github/workflows/ci.yml create mode 100644 e2e/billing.spec.ts create mode 100644 e2e/download.spec.ts create mode 100644 e2e/fixtures.ts create mode 100644 e2e/registration.spec.ts create mode 100644 playwright.config.ts create mode 100644 tests/fake-immich/server.test.ts create mode 100644 tests/fake-immich/server.ts diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..5ddd98c --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,89 @@ +name: CI Quality Gates + +on: + push: + branches: [main, "codex/**"] + pull_request: + branches: [main] + +jobs: + quality-gates: + name: Lint, Typecheck, Unit Tests & Build + runs-on: ubuntu-latest + + services: + postgres: + image: postgres:17-alpine + env: + POSTGRES_DB: portal_test + POSTGRES_USER: portal_test + POSTGRES_PASSWORD: portal_test_password + ports: + - 5432:5432 + options: >- + --health-cmd pg_isready + --health-interval 5s + --health-timeout 5s + --health-retries 5 + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup Node.js 24 + uses: actions/setup-node@v4 + with: + node-version: "24" + + - name: Setup pnpm + uses: pnpm/action-setup@v4 + with: + version: 10.34.5 + + - name: Get pnpm store directory + id: pnpm-cache + shell: bash + run: | + echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_OUTPUT + + - name: Setup pnpm cache + uses: actions/cache@v4 + with: + path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-pnpm-store- + + - name: Install dependencies + run: pnpm install --frozen-lockfile + + - name: Lint check + run: pnpm lint + + - name: Typecheck + run: pnpm typecheck + + - name: Unit and Integration Tests + env: + DATABASE_URL: postgres://portal_test:portal_test_password@localhost:5432/portal_test + run: pnpm test + + - name: Next.js Production Build + env: + DATABASE_URL: postgres://portal_test:portal_test_password@localhost:5432/portal_test + BETTER_AUTH_SECRET: ci-testing-secret-key-32-characters-min + BETTER_AUTH_URL: http://localhost:3000 + IMMICH_BASE_URL: http://localhost:2283 + IMMICH_API_KEY: ci-test-immich-api-key + SMTP_HOST: localhost + SMTP_PORT: 587 + SMTP_USER: portal@localhost + SMTP_PASSWORD: ci-password + SMTP_FROM: portal@localhost + LEGAL_IMPRINT_URL: https://example.com/imprint + LEGAL_PRIVACY_URL: https://example.com/privacy + LEGAL_TERMS_URL: https://example.com/terms + run: pnpm build + + - name: Build Docker Container + run: docker build -t portal-app:ci . diff --git a/e2e/billing.spec.ts b/e2e/billing.spec.ts new file mode 100644 index 0000000..ef1eedd --- /dev/null +++ b/e2e/billing.spec.ts @@ -0,0 +1,8 @@ +import { test, expect } from "./fixtures"; + +test.describe("Billing Reports Administration", () => { + test("redirects unauthenticated user from billing admin pages", async ({ page }) => { + await page.goto("/admin/abrechnungen"); + await expect(page).toHaveURL(/\/anmelden/); + }); +}); diff --git a/e2e/download.spec.ts b/e2e/download.spec.ts new file mode 100644 index 0000000..dccfa17 --- /dev/null +++ b/e2e/download.spec.ts @@ -0,0 +1,9 @@ +import { test, expect } from "./fixtures"; + +test.describe("Usage Accounting and Download Flow", () => { + test("shows login page for unauthenticated access to photo catalog", async ({ page }) => { + await page.goto("/redaktion/alben"); + await expect(page).toHaveURL(/\/anmelden/); + await expect(page.getByRole("button", { name: /Anmelden/i })).toBeVisible(); + }); +}); diff --git a/e2e/fixtures.ts b/e2e/fixtures.ts new file mode 100644 index 0000000..3436f93 --- /dev/null +++ b/e2e/fixtures.ts @@ -0,0 +1,34 @@ +/* eslint-disable react-hooks/rules-of-hooks */ +import { test as base } from "@playwright/test"; + +export type EditorialFixture = { + organizationName: string; + name: string; + email: string; + password: string; + street: string; + postalCode: string; + city: string; + countryCode: string; +}; + +export const editorialFixture: EditorialFixture = { + organizationName: "Suddeutsche Zeitung", + name: "Redaktion Sport", + email: "sport@sz-example.de", + password: "SecurePassword123!", + street: "Sendlinger Str. 8", + postalCode: "80331", + city: "Munchen", + countryCode: "DE", +}; + +export const test = base.extend<{ + editorialData: EditorialFixture; +}>({ + editorialData: async ({}, use) => { + await use(editorialFixture); + }, +}); + +export { expect } from "@playwright/test"; diff --git a/e2e/registration.spec.ts b/e2e/registration.spec.ts new file mode 100644 index 0000000..cb7616b --- /dev/null +++ b/e2e/registration.spec.ts @@ -0,0 +1,21 @@ +import { test, expect } from "./fixtures"; + +test.describe("B2B Editorial Registration and Approval Flow", () => { + test("user can register and views pending status page", async ({ page, editorialData }) => { + await page.goto("/registrieren"); + + await page.getByLabel("Organisation / Redaktion").fill(editorialData.organizationName); + await page.getByLabel("Ansprechpartner / Name").fill(editorialData.name); + await page.getByLabel("E-Mail-Adresse").fill(editorialData.email); + await page.getByLabel("Passwort", { exact: true }).fill(editorialData.password); + await page.getByLabel("Passwort wiederholen").fill(editorialData.password); + await page.getByLabel("Straße und Hausnummer").fill(editorialData.street); + await page.getByLabel("Postleitzahl").fill(editorialData.postalCode); + await page.getByLabel("Ort / Stadt").fill(editorialData.city); + + await page.getByRole("button", { name: /Konto erstellen/i }).click(); + + await expect(page).toHaveURL(/\/registrieren\/bestaetigt/); + await expect(page.getByText(/Freischaltung ausstehend|ausstehend/i)).toBeVisible(); + }); +}); diff --git a/package.json b/package.json index 6a2b39a..dfb32a8 100644 --- a/package.json +++ b/package.json @@ -30,6 +30,7 @@ "zod": "^4.4.3" }, "devDependencies": { + "@playwright/test": "^1.50.0", "@tailwindcss/postcss": "^4.3.3", "@testcontainers/postgresql": "^12.1.0", "@testing-library/jest-dom": "^7.0.0", diff --git a/playwright.config.ts b/playwright.config.ts new file mode 100644 index 0000000..2d3b67a --- /dev/null +++ b/playwright.config.ts @@ -0,0 +1,27 @@ +import { defineConfig, devices } from "@playwright/test"; + +export default defineConfig({ + testDir: "./e2e", + fullyParallel: false, + forbidOnly: !!process.env.CI, + retries: process.env.CI ? 2 : 0, + workers: 1, + reporter: "list", + use: { + baseURL: process.env.PLAYWRIGHT_TEST_BASE_URL || "http://localhost:3000", + trace: "on-first-retry", + }, + projects: [ + { + name: "chromium", + use: { ...devices["Desktop Chrome"] }, + }, + ], + webServer: { + command: "NEXT_DISABLE_TURBOPACK=1 npx next dev", + url: "http://localhost:3000", + reuseExistingServer: !process.env.CI, + stdout: "ignore", + stderr: "pipe", + }, +}); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6e01cd7..9ea3c1b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -16,13 +16,13 @@ importers: version: 0.5.1 better-auth: specifier: ^1.6.26 - version: 1.6.26(drizzle-kit@0.31.10)(drizzle-orm@0.45.2(@types/pg@8.21.0)(kysely@0.29.4)(pg@8.22.0))(next@16.3.0(@babel/core@7.29.7(supports-color@7.2.0))(@types/node@24.13.3)(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(pg@8.22.0)(react-dom@19.2.8(react@19.2.8))(react@19.2.8)(vitest@4.1.10(@types/node@24.13.3)(jsdom@30.0.1(@noble/hashes@2.3.0))(msw@2.15.0(@types/node@24.13.3)(typescript@5.9.3))(vite@8.2.1(@types/node@24.13.3)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.23.11)(yaml@2.9.0))) + version: 1.6.26(drizzle-kit@0.31.10)(drizzle-orm@0.45.2(@types/pg@8.21.0)(kysely@0.29.4)(pg@8.22.0))(next@16.3.0(@babel/core@7.29.7)(@playwright/test@1.62.1)(@types/node@24.13.3)(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(pg@8.22.0)(react-dom@19.2.8(react@19.2.8))(react@19.2.8)(vitest@4.1.10(@types/node@24.13.3)(jsdom@30.0.1(@noble/hashes@2.3.0))(msw@2.15.0(@types/node@24.13.3)(typescript@5.9.3))(vite@8.2.1(@types/node@24.13.3)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.23.11)(yaml@2.9.0))) drizzle-orm: specifier: ^0.45.2 version: 0.45.2(@types/pg@8.21.0)(kysely@0.29.4)(pg@8.22.0) next: specifier: ^16.3.0 - version: 16.3.0(@babel/core@7.29.7(supports-color@7.2.0))(@types/node@24.13.3)(react-dom@19.2.8(react@19.2.8))(react@19.2.8) + version: 16.3.0(@babel/core@7.29.7)(@playwright/test@1.62.1)(@types/node@24.13.3)(react-dom@19.2.8(react@19.2.8))(react@19.2.8) nodemailer: specifier: ^9.0.5 version: 9.0.5 @@ -45,12 +45,15 @@ importers: specifier: ^4.4.3 version: 4.4.3 devDependencies: + '@playwright/test': + specifier: ^1.50.0 + version: 1.62.1 '@tailwindcss/postcss': specifier: ^4.3.3 version: 4.3.3 '@testcontainers/postgresql': specifier: ^12.1.0 - version: 12.1.0(supports-color@7.2.0) + version: 12.1.0 '@testing-library/jest-dom': specifier: ^7.0.0 version: 7.0.0(@testing-library/dom@10.4.1) @@ -83,10 +86,10 @@ importers: version: 0.31.10 eslint: specifier: ^9.39.5 - version: 9.39.5(jiti@2.7.0)(supports-color@7.2.0) + version: 9.39.5(jiti@2.7.0) eslint-config-next: specifier: ^16.3.0 - version: 16.3.0(@typescript-eslint/parser@8.66.0(eslint@9.39.5(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0)(typescript@5.9.3))(eslint@9.39.5(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0)(typescript@5.9.3) + version: 16.3.0(@typescript-eslint/parser@8.66.0(eslint@9.39.5(jiti@2.7.0))(typescript@5.9.3))(eslint@9.39.5(jiti@2.7.0))(typescript@5.9.3) jsdom: specifier: ^30.0.1 version: 30.0.1(@noble/hashes@2.3.0) @@ -101,7 +104,7 @@ importers: version: 4.3.3 testcontainers: specifier: ^12.1.0 - version: 12.1.0(supports-color@7.2.0) + version: 12.1.0 tsx: specifier: ^4.23.11 version: 4.23.11 @@ -1305,6 +1308,11 @@ packages: resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==} engines: {node: '>=14'} + '@playwright/test@1.62.1': + resolution: {integrity: sha512-DTcUc8qii+cpHvtOwggMtBRMjKZHXYWdw8syRYu2vtzuq4Wxphqq4NfCs5Zt44L6mA8rfDfj+PHnxFc/FeK6mQ==} + engines: {node: '>=20'} + hasBin: true + '@protobufjs/aspromise@1.1.2': resolution: {integrity: sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==} @@ -2726,6 +2734,11 @@ packages: fs-constants@1.0.0: resolution: {integrity: sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==} + fsevents@2.3.2: + resolution: {integrity: sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==} + engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} + os: [darwin] + fsevents@2.3.3: resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} @@ -3555,6 +3568,16 @@ packages: resolution: {integrity: sha512-RvwwcruNjI1ncT5xRakeyS9Lf8lcItv34KD+aif+VH9kduAyfYBipGh12274xtenIPZ119/R9BdTBa8gAwSh0A==} engines: {node: '>=12'} + playwright-core@1.62.1: + resolution: {integrity: sha512-wPYSwEBJY9GHraISXqyqtx0na0LpO3XEX7jNDhntbex7tzUS7kLnZsOlFruFJB4Hi/rhDMjXGqHewDZ68nYZVw==} + engines: {node: '>=20'} + hasBin: true + + playwright@1.62.1: + resolution: {integrity: sha512-0M+L3LAD8/nm554LOla9Ayx0j0tmFZ0FBcoQ7F1VuVHpM/XpiC8RcDzBQB8W5+hA8L22THxELzeF+2WcUzvcLg==} + engines: {node: '>=20'} + hasBin: true + png-js@1.1.0: resolution: {integrity: sha512-PM/uYGzGdNSzqeOgly68+6wKQDL1SY0a/N+OEa/+br6LnHWOAJB0Npiamnodfq3jd2LS/i2fMeOKSAILjA+m5Q==} @@ -4337,20 +4360,20 @@ snapshots: '@babel/compat-data@7.29.7': {} - '@babel/core@7.29.7(supports-color@7.2.0)': + '@babel/core@7.29.7': dependencies: '@babel/code-frame': 7.29.7 '@babel/generator': 7.29.8 '@babel/helper-compilation-targets': 7.29.7 - '@babel/helper-module-transforms': 7.29.7(@babel/core@7.29.7(supports-color@7.2.0))(supports-color@7.2.0) + '@babel/helper-module-transforms': 7.29.7(@babel/core@7.29.7) '@babel/helpers': 7.29.7 '@babel/parser': 7.29.8 '@babel/template': 7.29.7 - '@babel/traverse': 7.29.8(supports-color@7.2.0) + '@babel/traverse': 7.29.8 '@babel/types': 7.29.8 '@jridgewell/remapping': 2.3.5 convert-source-map: 2.0.0 - debug: 4.4.3(supports-color@7.2.0) + debug: 4.4.3 gensync: 1.0.0-beta.2 json5: 2.2.3 semver: 6.3.1 @@ -4375,19 +4398,19 @@ snapshots: '@babel/helper-globals@7.29.7': {} - '@babel/helper-module-imports@7.29.7(supports-color@7.2.0)': + '@babel/helper-module-imports@7.29.7': dependencies: - '@babel/traverse': 7.29.8(supports-color@7.2.0) + '@babel/traverse': 7.29.8 '@babel/types': 7.29.8 transitivePeerDependencies: - supports-color - '@babel/helper-module-transforms@7.29.7(@babel/core@7.29.7(supports-color@7.2.0))(supports-color@7.2.0)': + '@babel/helper-module-transforms@7.29.7(@babel/core@7.29.7)': dependencies: - '@babel/core': 7.29.7(supports-color@7.2.0) - '@babel/helper-module-imports': 7.29.7(supports-color@7.2.0) + '@babel/core': 7.29.7 + '@babel/helper-module-imports': 7.29.7 '@babel/helper-validator-identifier': 7.29.7 - '@babel/traverse': 7.29.8(supports-color@7.2.0) + '@babel/traverse': 7.29.8 transitivePeerDependencies: - supports-color @@ -4414,7 +4437,7 @@ snapshots: '@babel/parser': 7.29.8 '@babel/types': 7.29.8 - '@babel/traverse@7.29.8(supports-color@7.2.0)': + '@babel/traverse@7.29.8': dependencies: '@babel/code-frame': 7.29.7 '@babel/generator': 7.29.8 @@ -4422,7 +4445,7 @@ snapshots: '@babel/parser': 7.29.8 '@babel/template': 7.29.7 '@babel/types': 7.29.8 - debug: 4.4.3(supports-color@7.2.0) + debug: 4.4.3 transitivePeerDependencies: - supports-color @@ -4773,22 +4796,22 @@ snapshots: '@esbuild/win32-x64@0.28.1': optional: true - '@eslint-community/eslint-utils@4.10.1(eslint@9.39.5(jiti@2.7.0)(supports-color@7.2.0))': + '@eslint-community/eslint-utils@4.10.1(eslint@9.39.5(jiti@2.7.0))': dependencies: - eslint: 9.39.5(jiti@2.7.0)(supports-color@7.2.0) + eslint: 9.39.5(jiti@2.7.0) eslint-visitor-keys: 3.4.3 - '@eslint-community/eslint-utils@4.9.1(eslint@9.39.5(jiti@2.7.0)(supports-color@7.2.0))': + '@eslint-community/eslint-utils@4.9.1(eslint@9.39.5(jiti@2.7.0))': dependencies: - eslint: 9.39.5(jiti@2.7.0)(supports-color@7.2.0) + eslint: 9.39.5(jiti@2.7.0) eslint-visitor-keys: 3.4.3 '@eslint-community/regexpp@4.12.2': {} - '@eslint/config-array@0.21.2(supports-color@7.2.0)': + '@eslint/config-array@0.21.2': dependencies: '@eslint/object-schema': 2.1.7 - debug: 4.4.3(supports-color@7.2.0) + debug: 4.4.3 minimatch: 3.1.5 transitivePeerDependencies: - supports-color @@ -4801,10 +4824,10 @@ snapshots: dependencies: '@types/json-schema': 7.0.15 - '@eslint/eslintrc@3.3.6(supports-color@7.2.0)': + '@eslint/eslintrc@3.3.6': dependencies: ajv: 6.15.0 - debug: 4.4.3(supports-color@7.2.0) + debug: 4.4.3 espree: 10.4.0 globals: 14.0.0 ignore: 5.3.2 @@ -5031,9 +5054,9 @@ snapshots: dependencies: jsbi: 4.3.2 - '@kwsites/file-exists@1.1.1(supports-color@7.2.0)': + '@kwsites/file-exists@1.1.1': dependencies: - debug: 4.4.3(supports-color@7.2.0) + debug: 4.4.3 transitivePeerDependencies: - supports-color @@ -5103,9 +5126,9 @@ snapshots: '@next/env@16.3.0': {} - '@next/eslint-plugin-next@16.3.0(eslint@9.39.5(jiti@2.7.0)(supports-color@7.2.0))': + '@next/eslint-plugin-next@16.3.0(eslint@9.39.5(jiti@2.7.0))': dependencies: - '@eslint-community/eslint-utils': 4.9.1(eslint@9.39.5(jiti@2.7.0)(supports-color@7.2.0)) + '@eslint-community/eslint-utils': 4.9.1(eslint@9.39.5(jiti@2.7.0)) fast-glob: 3.3.1 transitivePeerDependencies: - eslint @@ -5174,6 +5197,10 @@ snapshots: '@pkgjs/parseargs@0.11.0': optional: true + '@playwright/test@1.62.1': + dependencies: + playwright: 1.62.1 + '@protobufjs/aspromise@1.1.2': {} '@protobufjs/base64@1.1.2': {} @@ -5315,9 +5342,9 @@ snapshots: postcss: 8.5.23 tailwindcss: 4.3.3 - '@testcontainers/postgresql@12.1.0(supports-color@7.2.0)': + '@testcontainers/postgresql@12.1.0': dependencies: - testcontainers: 12.1.0(supports-color@7.2.0) + testcontainers: 12.1.0 transitivePeerDependencies: - bare-abort-controller - bare-buffer @@ -5440,15 +5467,15 @@ snapshots: '@types/statuses@2.0.6': {} - '@typescript-eslint/eslint-plugin@8.66.0(@typescript-eslint/parser@8.66.0(eslint@9.39.5(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0)(typescript@5.9.3))(eslint@9.39.5(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0)(typescript@5.9.3)': + '@typescript-eslint/eslint-plugin@8.66.0(@typescript-eslint/parser@8.66.0(eslint@9.39.5(jiti@2.7.0))(typescript@5.9.3))(eslint@9.39.5(jiti@2.7.0))(typescript@5.9.3)': dependencies: '@eslint-community/regexpp': 4.12.2 - '@typescript-eslint/parser': 8.66.0(eslint@9.39.5(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0)(typescript@5.9.3) + '@typescript-eslint/parser': 8.66.0(eslint@9.39.5(jiti@2.7.0))(typescript@5.9.3) '@typescript-eslint/scope-manager': 8.66.0 - '@typescript-eslint/type-utils': 8.66.0(eslint@9.39.5(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0)(typescript@5.9.3) - '@typescript-eslint/utils': 8.66.0(eslint@9.39.5(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0)(typescript@5.9.3) + '@typescript-eslint/type-utils': 8.66.0(eslint@9.39.5(jiti@2.7.0))(typescript@5.9.3) + '@typescript-eslint/utils': 8.66.0(eslint@9.39.5(jiti@2.7.0))(typescript@5.9.3) '@typescript-eslint/visitor-keys': 8.66.0 - eslint: 9.39.5(jiti@2.7.0)(supports-color@7.2.0) + eslint: 9.39.5(jiti@2.7.0) ignore: 7.0.6 natural-compare: 1.4.0 ts-api-utils: 2.5.0(typescript@5.9.3) @@ -5456,23 +5483,23 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/parser@8.66.0(eslint@9.39.5(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0)(typescript@5.9.3)': + '@typescript-eslint/parser@8.66.0(eslint@9.39.5(jiti@2.7.0))(typescript@5.9.3)': dependencies: '@typescript-eslint/scope-manager': 8.66.0 '@typescript-eslint/types': 8.66.0 - '@typescript-eslint/typescript-estree': 8.66.0(supports-color@7.2.0)(typescript@5.9.3) + '@typescript-eslint/typescript-estree': 8.66.0(typescript@5.9.3) '@typescript-eslint/visitor-keys': 8.66.0 - debug: 4.4.3(supports-color@7.2.0) - eslint: 9.39.5(jiti@2.7.0)(supports-color@7.2.0) + debug: 4.4.3 + eslint: 9.39.5(jiti@2.7.0) typescript: 5.9.3 transitivePeerDependencies: - supports-color - '@typescript-eslint/project-service@8.66.0(supports-color@7.2.0)(typescript@5.9.3)': + '@typescript-eslint/project-service@8.66.0(typescript@5.9.3)': dependencies: '@typescript-eslint/tsconfig-utils': 8.66.0(typescript@5.9.3) '@typescript-eslint/types': 8.66.0 - debug: 4.4.3(supports-color@7.2.0) + debug: 4.4.3 typescript: 5.9.3 transitivePeerDependencies: - supports-color @@ -5486,13 +5513,13 @@ snapshots: dependencies: typescript: 5.9.3 - '@typescript-eslint/type-utils@8.66.0(eslint@9.39.5(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0)(typescript@5.9.3)': + '@typescript-eslint/type-utils@8.66.0(eslint@9.39.5(jiti@2.7.0))(typescript@5.9.3)': dependencies: '@typescript-eslint/types': 8.66.0 - '@typescript-eslint/typescript-estree': 8.66.0(supports-color@7.2.0)(typescript@5.9.3) - '@typescript-eslint/utils': 8.66.0(eslint@9.39.5(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0)(typescript@5.9.3) - debug: 4.4.3(supports-color@7.2.0) - eslint: 9.39.5(jiti@2.7.0)(supports-color@7.2.0) + '@typescript-eslint/typescript-estree': 8.66.0(typescript@5.9.3) + '@typescript-eslint/utils': 8.66.0(eslint@9.39.5(jiti@2.7.0))(typescript@5.9.3) + debug: 4.4.3 + eslint: 9.39.5(jiti@2.7.0) ts-api-utils: 2.5.0(typescript@5.9.3) typescript: 5.9.3 transitivePeerDependencies: @@ -5500,13 +5527,13 @@ snapshots: '@typescript-eslint/types@8.66.0': {} - '@typescript-eslint/typescript-estree@8.66.0(supports-color@7.2.0)(typescript@5.9.3)': + '@typescript-eslint/typescript-estree@8.66.0(typescript@5.9.3)': dependencies: - '@typescript-eslint/project-service': 8.66.0(supports-color@7.2.0)(typescript@5.9.3) + '@typescript-eslint/project-service': 8.66.0(typescript@5.9.3) '@typescript-eslint/tsconfig-utils': 8.66.0(typescript@5.9.3) '@typescript-eslint/types': 8.66.0 '@typescript-eslint/visitor-keys': 8.66.0 - debug: 4.4.3(supports-color@7.2.0) + debug: 4.4.3 minimatch: 10.2.6 semver: 7.8.5 tinyglobby: 0.2.17 @@ -5515,13 +5542,13 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/utils@8.66.0(eslint@9.39.5(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0)(typescript@5.9.3)': + '@typescript-eslint/utils@8.66.0(eslint@9.39.5(jiti@2.7.0))(typescript@5.9.3)': dependencies: - '@eslint-community/eslint-utils': 4.10.1(eslint@9.39.5(jiti@2.7.0)(supports-color@7.2.0)) + '@eslint-community/eslint-utils': 4.10.1(eslint@9.39.5(jiti@2.7.0)) '@typescript-eslint/scope-manager': 8.66.0 '@typescript-eslint/types': 8.66.0 - '@typescript-eslint/typescript-estree': 8.66.0(supports-color@7.2.0)(typescript@5.9.3) - eslint: 9.39.5(jiti@2.7.0)(supports-color@7.2.0) + '@typescript-eslint/typescript-estree': 8.66.0(typescript@5.9.3) + eslint: 9.39.5(jiti@2.7.0) typescript: 5.9.3 transitivePeerDependencies: - supports-color @@ -5843,7 +5870,7 @@ snapshots: dependencies: tweetnacl: 0.14.5 - better-auth@1.6.26(drizzle-kit@0.31.10)(drizzle-orm@0.45.2(@types/pg@8.21.0)(kysely@0.29.4)(pg@8.22.0))(next@16.3.0(@babel/core@7.29.7(supports-color@7.2.0))(@types/node@24.13.3)(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(pg@8.22.0)(react-dom@19.2.8(react@19.2.8))(react@19.2.8)(vitest@4.1.10(@types/node@24.13.3)(jsdom@30.0.1(@noble/hashes@2.3.0))(msw@2.15.0(@types/node@24.13.3)(typescript@5.9.3))(vite@8.2.1(@types/node@24.13.3)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.23.11)(yaml@2.9.0))): + better-auth@1.6.26(drizzle-kit@0.31.10)(drizzle-orm@0.45.2(@types/pg@8.21.0)(kysely@0.29.4)(pg@8.22.0))(next@16.3.0(@babel/core@7.29.7)(@playwright/test@1.62.1)(@types/node@24.13.3)(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(pg@8.22.0)(react-dom@19.2.8(react@19.2.8))(react@19.2.8)(vitest@4.1.10(@types/node@24.13.3)(jsdom@30.0.1(@noble/hashes@2.3.0))(msw@2.15.0(@types/node@24.13.3)(typescript@5.9.3))(vite@8.2.1(@types/node@24.13.3)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.23.11)(yaml@2.9.0))): dependencies: '@better-auth/core': 1.6.26(@better-auth/utils@0.4.2)(@better-fetch/fetch@1.3.1)(better-call@1.3.7(zod@4.4.3))(jose@6.2.8)(kysely@0.29.4)(nanostores@1.4.2) '@better-auth/drizzle-adapter': 1.6.26(@better-auth/core@1.6.26(@better-auth/utils@0.4.2)(@better-fetch/fetch@1.3.1)(better-call@1.3.7(zod@4.4.3))(jose@6.2.8)(kysely@0.29.4)(nanostores@1.4.2))(@better-auth/utils@0.4.2)(drizzle-orm@0.45.2(@types/pg@8.21.0)(kysely@0.29.4)(pg@8.22.0)) @@ -5865,7 +5892,7 @@ snapshots: optionalDependencies: drizzle-kit: 0.31.10 drizzle-orm: 0.45.2(@types/pg@8.21.0)(kysely@0.29.4)(pg@8.22.0) - next: 16.3.0(@babel/core@7.29.7(supports-color@7.2.0))(@types/node@24.13.3)(react-dom@19.2.8(react@19.2.8))(react@19.2.8) + next: 16.3.0(@babel/core@7.29.7)(@playwright/test@1.62.1)(@types/node@24.13.3)(react-dom@19.2.8(react@19.2.8))(react@19.2.8) pg: 8.22.0 react: 19.2.8 react-dom: 19.2.8(react@19.2.8) @@ -6064,17 +6091,13 @@ snapshots: es-errors: 1.3.0 is-data-view: 1.0.2 - debug@3.2.7(supports-color@7.2.0): + debug@3.2.7: dependencies: ms: 2.1.3 - optionalDependencies: - supports-color: 7.2.0 - debug@4.4.3(supports-color@7.2.0): + debug@4.4.3: dependencies: ms: 2.1.3 - optionalDependencies: - supports-color: 7.2.0 decimal.js@10.6.0: {} @@ -6104,21 +6127,21 @@ snapshots: dependencies: yaml: 2.9.0 - docker-modem@5.0.7(supports-color@7.2.0): + docker-modem@5.0.7: dependencies: - debug: 4.4.3(supports-color@7.2.0) + debug: 4.4.3 readable-stream: 3.6.2 split-ca: 1.0.1 ssh2: 1.17.0 transitivePeerDependencies: - supports-color - dockerode@5.0.1(supports-color@7.2.0): + dockerode@5.0.1: dependencies: '@balena/dockerignore': 1.0.2 '@grpc/grpc-js': 1.14.4 '@grpc/proto-loader': 0.7.15 - docker-modem: 5.0.7(supports-color@7.2.0) + docker-modem: 5.0.7 protobufjs: 7.6.5 tar-fs: 2.1.5 transitivePeerDependencies: @@ -6370,18 +6393,18 @@ snapshots: escape-string-regexp@4.0.0: {} - eslint-config-next@16.3.0(@typescript-eslint/parser@8.66.0(eslint@9.39.5(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0)(typescript@5.9.3))(eslint@9.39.5(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0)(typescript@5.9.3): + eslint-config-next@16.3.0(@typescript-eslint/parser@8.66.0(eslint@9.39.5(jiti@2.7.0))(typescript@5.9.3))(eslint@9.39.5(jiti@2.7.0))(typescript@5.9.3): dependencies: - '@next/eslint-plugin-next': 16.3.0(eslint@9.39.5(jiti@2.7.0)(supports-color@7.2.0)) - eslint: 9.39.5(jiti@2.7.0)(supports-color@7.2.0) - eslint-import-resolver-node: 0.3.10(supports-color@7.2.0) - eslint-import-resolver-typescript: 3.10.1(eslint-plugin-import@2.32.0)(eslint@9.39.5(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0) - eslint-plugin-import: 2.32.0(@typescript-eslint/parser@8.66.0(eslint@9.39.5(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0)(typescript@5.9.3))(eslint-import-resolver-typescript@3.10.1)(eslint@9.39.5(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0) - eslint-plugin-jsx-a11y: 6.10.2(eslint@9.39.5(jiti@2.7.0)(supports-color@7.2.0)) - eslint-plugin-react: 7.37.5(eslint@9.39.5(jiti@2.7.0)(supports-color@7.2.0)) - eslint-plugin-react-hooks: 7.1.1(eslint@9.39.5(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0) + '@next/eslint-plugin-next': 16.3.0(eslint@9.39.5(jiti@2.7.0)) + eslint: 9.39.5(jiti@2.7.0) + eslint-import-resolver-node: 0.3.10 + eslint-import-resolver-typescript: 3.10.1(eslint-plugin-import@2.32.0)(eslint@9.39.5(jiti@2.7.0)) + eslint-plugin-import: 2.32.0(@typescript-eslint/parser@8.66.0(eslint@9.39.5(jiti@2.7.0))(typescript@5.9.3))(eslint-import-resolver-typescript@3.10.1)(eslint@9.39.5(jiti@2.7.0)) + eslint-plugin-jsx-a11y: 6.10.2(eslint@9.39.5(jiti@2.7.0)) + eslint-plugin-react: 7.37.5(eslint@9.39.5(jiti@2.7.0)) + eslint-plugin-react-hooks: 7.1.1(eslint@9.39.5(jiti@2.7.0)) globals: 16.4.0 - typescript-eslint: 8.66.0(eslint@9.39.5(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0)(typescript@5.9.3) + typescript-eslint: 8.66.0(eslint@9.39.5(jiti@2.7.0))(typescript@5.9.3) optionalDependencies: typescript: 5.9.3 transitivePeerDependencies: @@ -6390,52 +6413,52 @@ snapshots: - eslint-plugin-import-x - supports-color - eslint-import-resolver-node@0.3.10(supports-color@7.2.0): + eslint-import-resolver-node@0.3.10: dependencies: - debug: 3.2.7(supports-color@7.2.0) + debug: 3.2.7 is-core-module: 2.16.2 resolve: 2.0.0-next.7 transitivePeerDependencies: - supports-color - eslint-import-resolver-typescript@3.10.1(eslint-plugin-import@2.32.0)(eslint@9.39.5(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0): + eslint-import-resolver-typescript@3.10.1(eslint-plugin-import@2.32.0)(eslint@9.39.5(jiti@2.7.0)): dependencies: '@nolyfill/is-core-module': 1.0.39 - debug: 4.4.3(supports-color@7.2.0) - eslint: 9.39.5(jiti@2.7.0)(supports-color@7.2.0) + debug: 4.4.3 + eslint: 9.39.5(jiti@2.7.0) get-tsconfig: 4.14.1 is-bun-module: 2.0.0 stable-hash: 0.0.5 tinyglobby: 0.2.17 unrs-resolver: 1.12.2 optionalDependencies: - eslint-plugin-import: 2.32.0(@typescript-eslint/parser@8.66.0(eslint@9.39.5(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0)(typescript@5.9.3))(eslint-import-resolver-typescript@3.10.1)(eslint@9.39.5(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0) + eslint-plugin-import: 2.32.0(@typescript-eslint/parser@8.66.0(eslint@9.39.5(jiti@2.7.0))(typescript@5.9.3))(eslint-import-resolver-typescript@3.10.1)(eslint@9.39.5(jiti@2.7.0)) transitivePeerDependencies: - supports-color - eslint-module-utils@2.14.0(@typescript-eslint/parser@8.66.0(eslint@9.39.5(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0)(typescript@5.9.3))(eslint-import-resolver-node@0.3.10(supports-color@7.2.0))(eslint-import-resolver-typescript@3.10.1)(eslint@9.39.5(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0): + eslint-module-utils@2.14.0(@typescript-eslint/parser@8.66.0(eslint@9.39.5(jiti@2.7.0))(typescript@5.9.3))(eslint-import-resolver-node@0.3.10)(eslint-import-resolver-typescript@3.10.1)(eslint@9.39.5(jiti@2.7.0)): dependencies: - debug: 3.2.7(supports-color@7.2.0) + debug: 3.2.7 optionalDependencies: - '@typescript-eslint/parser': 8.66.0(eslint@9.39.5(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0)(typescript@5.9.3) - eslint: 9.39.5(jiti@2.7.0)(supports-color@7.2.0) - eslint-import-resolver-node: 0.3.10(supports-color@7.2.0) - eslint-import-resolver-typescript: 3.10.1(eslint-plugin-import@2.32.0)(eslint@9.39.5(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0) + '@typescript-eslint/parser': 8.66.0(eslint@9.39.5(jiti@2.7.0))(typescript@5.9.3) + eslint: 9.39.5(jiti@2.7.0) + eslint-import-resolver-node: 0.3.10 + eslint-import-resolver-typescript: 3.10.1(eslint-plugin-import@2.32.0)(eslint@9.39.5(jiti@2.7.0)) transitivePeerDependencies: - supports-color - eslint-plugin-import@2.32.0(@typescript-eslint/parser@8.66.0(eslint@9.39.5(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0)(typescript@5.9.3))(eslint-import-resolver-typescript@3.10.1)(eslint@9.39.5(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0): + eslint-plugin-import@2.32.0(@typescript-eslint/parser@8.66.0(eslint@9.39.5(jiti@2.7.0))(typescript@5.9.3))(eslint-import-resolver-typescript@3.10.1)(eslint@9.39.5(jiti@2.7.0)): dependencies: '@rtsao/scc': 1.1.0 array-includes: 3.1.9 array.prototype.findlastindex: 1.2.6 array.prototype.flat: 1.3.3 array.prototype.flatmap: 1.3.3 - debug: 3.2.7(supports-color@7.2.0) + debug: 3.2.7 doctrine: 2.1.0 - eslint: 9.39.5(jiti@2.7.0)(supports-color@7.2.0) - eslint-import-resolver-node: 0.3.10(supports-color@7.2.0) - eslint-module-utils: 2.14.0(@typescript-eslint/parser@8.66.0(eslint@9.39.5(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0)(typescript@5.9.3))(eslint-import-resolver-node@0.3.10(supports-color@7.2.0))(eslint-import-resolver-typescript@3.10.1)(eslint@9.39.5(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0) + eslint: 9.39.5(jiti@2.7.0) + eslint-import-resolver-node: 0.3.10 + eslint-module-utils: 2.14.0(@typescript-eslint/parser@8.66.0(eslint@9.39.5(jiti@2.7.0))(typescript@5.9.3))(eslint-import-resolver-node@0.3.10)(eslint-import-resolver-typescript@3.10.1)(eslint@9.39.5(jiti@2.7.0)) hasown: 2.0.4 is-core-module: 2.16.2 is-glob: 4.0.3 @@ -6447,13 +6470,13 @@ snapshots: string.prototype.trimend: 1.0.10 tsconfig-paths: 3.15.0 optionalDependencies: - '@typescript-eslint/parser': 8.66.0(eslint@9.39.5(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0)(typescript@5.9.3) + '@typescript-eslint/parser': 8.66.0(eslint@9.39.5(jiti@2.7.0))(typescript@5.9.3) transitivePeerDependencies: - eslint-import-resolver-typescript - eslint-import-resolver-webpack - supports-color - eslint-plugin-jsx-a11y@6.10.2(eslint@9.39.5(jiti@2.7.0)(supports-color@7.2.0)): + eslint-plugin-jsx-a11y@6.10.2(eslint@9.39.5(jiti@2.7.0)): dependencies: aria-query: 5.3.2 array-includes: 3.1.9 @@ -6463,7 +6486,7 @@ snapshots: axobject-query: 4.1.0 damerau-levenshtein: 1.0.8 emoji-regex: 9.2.2 - eslint: 9.39.5(jiti@2.7.0)(supports-color@7.2.0) + eslint: 9.39.5(jiti@2.7.0) hasown: 2.0.4 jsx-ast-utils: 3.3.5 language-tags: 1.0.9 @@ -6472,18 +6495,18 @@ snapshots: safe-regex-test: 1.1.0 string.prototype.includes: 2.0.1 - eslint-plugin-react-hooks@7.1.1(eslint@9.39.5(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0): + eslint-plugin-react-hooks@7.1.1(eslint@9.39.5(jiti@2.7.0)): dependencies: - '@babel/core': 7.29.7(supports-color@7.2.0) + '@babel/core': 7.29.7 '@babel/parser': 7.29.8 - eslint: 9.39.5(jiti@2.7.0)(supports-color@7.2.0) + eslint: 9.39.5(jiti@2.7.0) hermes-parser: 0.25.1 zod: 4.4.3 zod-validation-error: 4.0.2(zod@4.4.3) transitivePeerDependencies: - supports-color - eslint-plugin-react@7.37.5(eslint@9.39.5(jiti@2.7.0)(supports-color@7.2.0)): + eslint-plugin-react@7.37.5(eslint@9.39.5(jiti@2.7.0)): dependencies: array-includes: 3.1.9 array.prototype.findlast: 1.2.5 @@ -6491,7 +6514,7 @@ snapshots: array.prototype.tosorted: 1.1.4 doctrine: 2.1.0 es-iterator-helpers: 1.4.0 - eslint: 9.39.5(jiti@2.7.0)(supports-color@7.2.0) + eslint: 9.39.5(jiti@2.7.0) estraverse: 5.3.0 hasown: 2.0.4 jsx-ast-utils: 3.3.5 @@ -6516,14 +6539,14 @@ snapshots: eslint-visitor-keys@5.0.1: {} - eslint@9.39.5(jiti@2.7.0)(supports-color@7.2.0): + eslint@9.39.5(jiti@2.7.0): dependencies: - '@eslint-community/eslint-utils': 4.10.1(eslint@9.39.5(jiti@2.7.0)(supports-color@7.2.0)) + '@eslint-community/eslint-utils': 4.10.1(eslint@9.39.5(jiti@2.7.0)) '@eslint-community/regexpp': 4.12.2 - '@eslint/config-array': 0.21.2(supports-color@7.2.0) + '@eslint/config-array': 0.21.2 '@eslint/config-helpers': 0.4.2 '@eslint/core': 0.17.0 - '@eslint/eslintrc': 3.3.6(supports-color@7.2.0) + '@eslint/eslintrc': 3.3.6 '@eslint/js': 9.39.5 '@eslint/plugin-kit': 0.4.1 '@humanfs/node': 0.16.8 @@ -6533,7 +6556,7 @@ snapshots: ajv: 6.15.0 chalk: 4.1.2 cross-spawn: 7.0.6 - debug: 4.4.3(supports-color@7.2.0) + debug: 4.4.3 escape-string-regexp: 4.0.0 eslint-scope: 8.4.0 eslint-visitor-keys: 4.2.1 @@ -6668,6 +6691,9 @@ snapshots: fs-constants@1.0.0: {} + fsevents@2.3.2: + optional: true + fsevents@2.3.3: optional: true @@ -7254,7 +7280,7 @@ snapshots: natural-compare@1.4.0: {} - next@16.3.0(@babel/core@7.29.7(supports-color@7.2.0))(@types/node@24.13.3)(react-dom@19.2.8(react@19.2.8))(react@19.2.8): + next@16.3.0(@babel/core@7.29.7)(@playwright/test@1.62.1)(@types/node@24.13.3)(react-dom@19.2.8(react@19.2.8))(react@19.2.8): dependencies: '@next/env': 16.3.0 '@swc/helpers': 0.5.15 @@ -7263,7 +7289,7 @@ snapshots: postcss: 8.5.23 react: 19.2.8 react-dom: 19.2.8(react@19.2.8) - styled-jsx: 5.1.6(@babel/core@7.29.7(supports-color@7.2.0))(react@19.2.8) + styled-jsx: 5.1.6(@babel/core@7.29.7)(react@19.2.8) optionalDependencies: '@next/swc-darwin-arm64': 16.3.0 '@next/swc-darwin-x64': 16.3.0 @@ -7273,6 +7299,7 @@ snapshots: '@next/swc-linux-x64-musl': 16.3.0 '@next/swc-win32-arm64-msvc': 16.3.0 '@next/swc-win32-x64-msvc': 16.3.0 + '@playwright/test': 1.62.1 sharp: 0.35.3(@types/node@24.13.3) transitivePeerDependencies: - '@babel/core' @@ -7455,6 +7482,14 @@ snapshots: picomatch@4.0.5: {} + playwright-core@1.62.1: {} + + playwright@1.62.1: + dependencies: + playwright-core: 1.62.1 + optionalDependencies: + fsevents: 2.3.2 + png-js@1.1.0: dependencies: browserify-zlib: 0.2.0 @@ -7507,9 +7542,9 @@ snapshots: retry: 0.12.0 signal-exit: 3.0.7 - properties-reader@3.0.1(supports-color@7.2.0): + properties-reader@3.0.1: dependencies: - '@kwsites/file-exists': 1.1.1(supports-color@7.2.0) + '@kwsites/file-exists': 1.1.1 mkdirp: 3.0.1 transitivePeerDependencies: - supports-color @@ -7926,12 +7961,12 @@ snapshots: strip-json-comments@3.1.1: {} - styled-jsx@5.1.6(@babel/core@7.29.7(supports-color@7.2.0))(react@19.2.8): + styled-jsx@5.1.6(@babel/core@7.29.7)(react@19.2.8): dependencies: client-only: 0.0.1 react: 19.2.8 optionalDependencies: - '@babel/core': 7.29.7(supports-color@7.2.0) + '@babel/core': 7.29.7 supports-color@7.2.0: dependencies: @@ -7992,19 +8027,19 @@ snapshots: - bare-abort-controller - react-native-b4a - testcontainers@12.1.0(supports-color@7.2.0): + testcontainers@12.1.0: dependencies: '@balena/dockerignore': 1.0.2 '@types/dockerode': 4.0.1 archiver: 7.0.1 async-lock: 1.4.1 byline: 5.0.0 - debug: 4.4.3(supports-color@7.2.0) + debug: 4.4.3 docker-compose: 1.4.2 - dockerode: 5.0.1(supports-color@7.2.0) + dockerode: 5.0.1 get-port: 5.1.1 proper-lockfile: 4.1.2 - properties-reader: 3.0.1(supports-color@7.2.0) + properties-reader: 3.0.1 ssh-remote-port-forward: 1.0.4 tar-fs: 3.1.3 tmp: 0.2.7 @@ -8116,13 +8151,13 @@ snapshots: possible-typed-array-names: 1.1.0 reflect.getprototypeof: 1.0.10 - typescript-eslint@8.66.0(eslint@9.39.5(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0)(typescript@5.9.3): + typescript-eslint@8.66.0(eslint@9.39.5(jiti@2.7.0))(typescript@5.9.3): dependencies: - '@typescript-eslint/eslint-plugin': 8.66.0(@typescript-eslint/parser@8.66.0(eslint@9.39.5(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0)(typescript@5.9.3))(eslint@9.39.5(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0)(typescript@5.9.3) - '@typescript-eslint/parser': 8.66.0(eslint@9.39.5(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0)(typescript@5.9.3) - '@typescript-eslint/typescript-estree': 8.66.0(supports-color@7.2.0)(typescript@5.9.3) - '@typescript-eslint/utils': 8.66.0(eslint@9.39.5(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0)(typescript@5.9.3) - eslint: 9.39.5(jiti@2.7.0)(supports-color@7.2.0) + '@typescript-eslint/eslint-plugin': 8.66.0(@typescript-eslint/parser@8.66.0(eslint@9.39.5(jiti@2.7.0))(typescript@5.9.3))(eslint@9.39.5(jiti@2.7.0))(typescript@5.9.3) + '@typescript-eslint/parser': 8.66.0(eslint@9.39.5(jiti@2.7.0))(typescript@5.9.3) + '@typescript-eslint/typescript-estree': 8.66.0(typescript@5.9.3) + '@typescript-eslint/utils': 8.66.0(eslint@9.39.5(jiti@2.7.0))(typescript@5.9.3) + eslint: 9.39.5(jiti@2.7.0) typescript: 5.9.3 transitivePeerDependencies: - supports-color diff --git a/tests/fake-immich/server.test.ts b/tests/fake-immich/server.test.ts new file mode 100644 index 0000000..3133fc6 --- /dev/null +++ b/tests/fake-immich/server.test.ts @@ -0,0 +1,48 @@ +import { afterAll, beforeAll, describe, expect, test } from "vitest"; +import { createFakeImmichServer } from "./server"; + +describe("createFakeImmichServer", () => { + const fakeImmich = createFakeImmichServer({ port: 0 }); + let baseUrl = ""; + + beforeAll(async () => { + baseUrl = await fakeImmich.start(); + }); + + afterAll(async () => { + await fakeImmich.stop(); + }); + + test("serves album list", async () => { + const res = await fetch(`${baseUrl}/api/albums`, { + headers: { "x-api-key": "test-immich-api-key" }, + }); + expect(res.status).toBe(200); + const body = await res.json(); + expect(body).toHaveLength(1); + expect(body[0].albumName).toBe("Presse 2026"); + }); + + test("serves metadata search with album filter", async () => { + const res = await fetch(`${baseUrl}/api/search/metadata`, { + method: "POST", + headers: { + "content-type": "application/json", + "x-api-key": "test-immich-api-key", + }, + body: JSON.stringify({ albumIds: ["album-1"], type: "IMAGE" }), + }); + expect(res.status).toBe(200); + const body = await res.json(); + expect(body.assets.total).toBe(2); + }); + + test("simulates outage mode", async () => { + fakeImmich.setOutage(true); + const res = await fetch(`${baseUrl}/api/albums`, { + headers: { "x-api-key": "test-immich-api-key" }, + }); + expect(res.status).toBe(503); + fakeImmich.setOutage(false); + }); +}); diff --git a/tests/fake-immich/server.ts b/tests/fake-immich/server.ts new file mode 100644 index 0000000..78b1859 --- /dev/null +++ b/tests/fake-immich/server.ts @@ -0,0 +1,214 @@ +import { createServer, type Server, type IncomingMessage, type ServerResponse } from "node:http"; + +export type FakeImmichAsset = { + id: string; + type: "IMAGE"; + originalFileName: string; + originalMimeType: string; + localDateTime: string; + fileCreatedAt: string; + albums: { id: string }[]; +}; + +export type FakeImmichAlbum = { + id: string; + albumName: string; + description: string | null; + albumThumbnailAssetId: string | null; + assetCount: number; + assets: FakeImmichAsset[]; +}; + +export type FakeImmichServerOptions = { + port?: number; + albums?: FakeImmichAlbum[]; + apiKey?: string; +}; + +const SAMPLE_1X1_JPEG = Buffer.from( + "/9j/4AAQSkZJRgABAQEASABIAAD/2wBDAP//////////////////////////////////////////////////////////////////////////////////////wgALCAABAAEBAREA/8QAFBABAAAAAAAAAAAAAAAAAAAAAP/aAAgBAQABPxA=", + "base64", +); + +export function createFakeImmichServer({ + port = 2283, + albums = [ + { + id: "album-1", + albumName: "Presse 2026", + description: "Offizielle Pressefotos", + albumThumbnailAssetId: "asset-1", + assetCount: 2, + assets: [ + { + id: "asset-1", + type: "IMAGE", + originalFileName: "IMG_4821.jpg", + originalMimeType: "image/jpeg", + localDateTime: "2026-08-01T12:00:00Z", + fileCreatedAt: "2026-08-01T12:00:00Z", + albums: [{ id: "album-1" }], + }, + { + id: "asset-2", + type: "IMAGE", + originalFileName: "IMG_4822.jpg", + originalMimeType: "image/jpeg", + localDateTime: "2026-08-02T14:00:00Z", + fileCreatedAt: "2026-08-02T14:00:00Z", + albums: [{ id: "album-1" }], + }, + ], + }, + ], + apiKey = "test-immich-api-key", +}: FakeImmichServerOptions = {}): { + server: Server; + start: () => Promise; + stop: () => Promise; + setOutage: (enabled: boolean) => void; +} { + let outage = false; + + const server = createServer(async (req: IncomingMessage, res: ServerResponse) => { + const reqApiKey = req.headers["x-api-key"]; + if (apiKey && reqApiKey !== apiKey) { + res.writeHead(401, { "content-type": "application/json" }); + res.end(JSON.stringify({ message: "Unauthorized" })); + return; + } + + if (outage) { + res.writeHead(503, { "content-type": "application/json" }); + res.end(JSON.stringify({ message: "Immich server unavailable" })); + return; + } + + const url = new URL(req.url || "/", `http://${req.headers.host || "localhost"}`); + const path = url.pathname; + + if (req.method === "GET" && path === "/api/albums") { + const summaries = albums.map(({ id, albumName, description, albumThumbnailAssetId, assetCount }) => ({ + id, + albumName, + description, + albumThumbnailAssetId, + assetCount, + })); + res.writeHead(200, { "content-type": "application/json" }); + res.end(JSON.stringify(summaries)); + return; + } + + const albumMatch = path.match(/^\/api\/albums\/([^/]+)$/); + if (req.method === "GET" && albumMatch) { + const albumId = decodeURIComponent(albumMatch[1]); + const album = albums.find((a) => a.id === albumId); + if (!album) { + res.writeHead(404, { "content-type": "application/json" }); + res.end(JSON.stringify({ message: "Album not found" })); + return; + } + res.writeHead(200, { "content-type": "application/json" }); + res.end(JSON.stringify(album)); + return; + } + + const assetMatch = path.match(/^\/api\/assets\/([^/]+)$/); + if (req.method === "GET" && assetMatch) { + const assetId = decodeURIComponent(assetMatch[1]); + const allAssets = albums.flatMap((a) => a.assets); + const asset = allAssets.find((a) => a.id === assetId); + if (!asset) { + res.writeHead(404, { "content-type": "application/json" }); + res.end(JSON.stringify({ message: "Asset not found" })); + return; + } + res.writeHead(200, { "content-type": "application/json" }); + res.end(JSON.stringify(asset)); + return; + } + + if (req.method === "POST" && path === "/api/search/metadata") { + let bodyStr = ""; + for await (const chunk of req) { + bodyStr += chunk; + } + const body = JSON.parse(bodyStr || "{}"); + const targetAlbumIds: string[] = body.albumIds || []; + const descriptionQuery: string | undefined = body.description; + const allAssets = albums + .filter((a) => targetAlbumIds.length === 0 || targetAlbumIds.includes(a.id)) + .flatMap((a) => a.assets); + + let items = allAssets; + if (descriptionQuery) { + items = items.filter((a) => a.originalFileName.toLowerCase().includes(descriptionQuery.toLowerCase())); + } + + res.writeHead(200, { "content-type": "application/json" }); + res.end( + JSON.stringify({ + assets: { + items, + total: items.length, + nextPage: null, + previousPage: null, + }, + }), + ); + return; + } + + const thumbMatch = path.match(/^\/api\/assets\/([^/]+)\/thumbnail$/); + if (req.method === "GET" && thumbMatch) { + res.writeHead(200, { + "content-type": "image/jpeg", + "content-length": String(SAMPLE_1X1_JPEG.length), + }); + res.end(SAMPLE_1X1_JPEG); + return; + } + + const origMatch = path.match(/^\/api\/assets\/([^/]+)\/original$/); + if (req.method === "GET" && origMatch) { + const assetId = decodeURIComponent(origMatch[1]); + const allAssets = albums.flatMap((a) => a.assets); + const asset = allAssets.find((a) => a.id === assetId); + const filename = asset?.originalFileName || `${assetId}.jpg`; + + res.writeHead(200, { + "content-type": "image/jpeg", + "content-length": String(SAMPLE_1X1_JPEG.length), + "content-disposition": `attachment; filename="${filename}"`, + }); + res.end(SAMPLE_1X1_JPEG); + return; + } + + res.writeHead(404, { "content-type": "application/json" }); + res.end(JSON.stringify({ message: "Not found" })); + }); + + return { + server, + start() { + return new Promise((resolve, reject) => { + server.listen(port, () => { + const addr = server.address(); + const actualPort = typeof addr === "object" && addr ? addr.port : port; + resolve(`http://localhost:${actualPort}`); + }); + server.on("error", reject); + }); + }, + stop() { + return new Promise((resolve, reject) => { + server.close((err) => (err ? reject(err) : resolve())); + }); + }, + setOutage(enabled: boolean) { + outage = enabled; + }, + }; +}