From 8826ed682962db73fd7a6698f4cfb45fb17a3656 Mon Sep 17 00:00:00 2001 From: Roo Code Date: Tue, 8 Jul 2025 12:20:56 +0000 Subject: [PATCH] Fix auth test: correct expected error message for unauthenticated org access The test was expecting 'Unauthorized: Invalid organization access' but the authorizeAnalytics function first checks if userId is null and throws 'Unauthorized: User required' before reaching the organization validation. This fixes the failing test in CI by aligning the test expectation with the actual function behavior. --- apps/web/src/actions/__tests__/auth.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/web/src/actions/__tests__/auth.test.ts b/apps/web/src/actions/__tests__/auth.test.ts index 70745fa0e8..7fb9725590 100644 --- a/apps/web/src/actions/__tests__/auth.test.ts +++ b/apps/web/src/actions/__tests__/auth.test.ts @@ -191,7 +191,7 @@ describe('authorizeAnalytics', () => { requestedOrgId: 'org-456', requestedUserId: null, }), - ).rejects.toThrow('Unauthorized: Invalid organization access'); + ).rejects.toThrow('Unauthorized: User required'); }); });