diff --git a/test/helpers/integration-harness.ts b/test/helpers/integration-harness.ts index af0070e..98addbe 100644 --- a/test/helpers/integration-harness.ts +++ b/test/helpers/integration-harness.ts @@ -101,7 +101,9 @@ function envForProcess(baseEnv: NodeJS.ProcessEnv): NodeJS.ProcessEnv { DEEPSEEK_API_KEY: 'sk-test', STORAGE_DRIVER: 'local', ENABLE_SWAGGER: 'false', - // No Bull Board in test + JWT_SECRET: baseEnv.JWT_SECRET || 'test-integration-secret', + JWT_ACCESS_EXPIRES_IN: '1h', + CREDENTIAL_ENCRYPTION_KEY: baseEnv.CREDENTIAL_ENCRYPTION_KEY || '0123456789abcdef0123456789abcdef', }; } diff --git a/test/m-ai-01-09-api-e2e.worker-int-spec.ts b/test/m-ai-01-09-api-e2e.worker-int-spec.ts index b8dbada..aba2f64 100644 --- a/test/m-ai-01-09-api-e2e.worker-int-spec.ts +++ b/test/m-ai-01-09-api-e2e.worker-int-spec.ts @@ -232,11 +232,12 @@ describe('API E2E: Active Recall', () => { expect(res.status).toBe(401); }); - it('404 不存在的 Question', async () => { + it('不存在的 Question 返回 404', async () => { const res = await httpPost('/api/active-recalls/nonexistent-id/submit', { answerText: 'A', }, userToken); - expect([403, 404]).toContain(res.status); + // Service throws NotFoundException → 404 + expect(res.status).toBe(404); }); });