From 93c884b93900c48e14a7936f070be6818d552630 Mon Sep 17 00:00:00 2001 From: Scott Cazan Date: Thu, 26 Feb 2026 22:53:46 +0100 Subject: [PATCH 1/2] Add in authUserId for feature flagging --- services/api/src/middlewares/withAnalytics.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/services/api/src/middlewares/withAnalytics.ts b/services/api/src/middlewares/withAnalytics.ts index 7cc520fc7..9eba6ab07 100644 --- a/services/api/src/middlewares/withAnalytics.ts +++ b/services/api/src/middlewares/withAnalytics.ts @@ -23,6 +23,7 @@ const withAnalytics: MiddlewareBuilderBase = async ({ try { // We are only identifying One Project users by email, matching frontend logic const properties: Record = {}; + properties.authUserId = user.id; if (posthogSessionId) { properties.$session_id = posthogSessionId; From b4cfefcfd35d7e8dc951e223d16966d155a22b3a Mon Sep 17 00:00:00 2001 From: Scott Cazan Date: Fri, 27 Feb 2026 12:31:24 +0100 Subject: [PATCH 2/2] use waitForResponse --- tests/e2e/tests/decisions.spec.ts | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/tests/e2e/tests/decisions.spec.ts b/tests/e2e/tests/decisions.spec.ts index 56cb0ed16..34815242b 100644 --- a/tests/e2e/tests/decisions.spec.ts +++ b/tests/e2e/tests/decisions.spec.ts @@ -30,12 +30,25 @@ test.describe('Decisions', () => { authenticatedPage.getByRole('heading', { name: instance.name }), ).toBeVisible({ timeout: 15000 }); - // 5. Click the "Submit a proposal" button + // 5. Click the "Submit a proposal" button and capture the mutation response const submitButton = authenticatedPage.getByRole('button', { name: 'Submit a proposal', }); await expect(submitButton).toBeVisible({ timeout: 5000 }); - await submitButton.click(); + + const [response] = await Promise.all([ + authenticatedPage.waitForResponse( + (resp) => resp.url().includes('decision.createProposal'), + { timeout: 15000 }, + ), + submitButton.click(), + ]); + + // Log mutation result to help diagnose CI failures + const responseBody = await response.text(); + console.log('createProposal response status:', response.status()); + console.log('createProposal response body:', responseBody); + expect(response.status()).toBe(200); // 6. Wait for navigation to the proposal edit page // The URL pattern is /decisions/{slug}/proposal/{profileId}/edit