diff --git a/tests/web/api.me.preferences.test.ts b/tests/web/api.me.preferences.test.ts index 3e3d65e..da1fe42 100644 --- a/tests/web/api.me.preferences.test.ts +++ b/tests/web/api.me.preferences.test.ts @@ -4,7 +4,7 @@ import { mkdtempSync, rmSync } from 'fs'; import { tmpdir } from 'os'; import { join } from 'path'; import { startWebServer } from './helpers/server'; -import { initializeDatabase } from '../../src/db'; +import { initializeDatabase, ensureUserExists } from '../../src/db'; async function sha256Hex(input: string): Promise { const enc = new TextEncoder().encode(input); @@ -32,6 +32,7 @@ describe('Web API - GET /api/me/preferences', () => { // Inicializar DB en archivo (como en prod) const db = new Database(dbPath); initializeDatabase(db); + ensureUserExists(userId, db); // Crear sesión válida const sid = 'sid-test-pref';