Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions services/api/src/middlewares/withAnalytics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const withAnalytics: MiddlewareBuilderBase<TContextWithAnalytics> = async ({
try {
// We are only identifying One Project users by email, matching frontend logic
const properties: Record<string, any> = {};
properties.authUserId = user.id;

if (posthogSessionId) {
properties.$session_id = posthogSessionId;
Expand Down
17 changes: 15 additions & 2 deletions tests/e2e/tests/decisions.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading