From f329bc167a2657e7fcb6db4106167257034e3698 Mon Sep 17 00:00:00 2001 From: Abhimanyu Saharan Date: Thu, 12 Feb 2026 14:42:25 +0000 Subject: [PATCH] test(e2e): stub /activity bootstrap so activityList request fires --- frontend/cypress/e2e/activity_feed.cy.ts | 32 ++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/frontend/cypress/e2e/activity_feed.cy.ts b/frontend/cypress/e2e/activity_feed.cy.ts index b58ab4fc..9460d7cf 100644 --- a/frontend/cypress/e2e/activity_feed.cy.ts +++ b/frontend/cypress/e2e/activity_feed.cy.ts @@ -46,6 +46,32 @@ describe("/activity feed", () => { cy.intercept("GET", `${apiBase}/agents/stream*`, emptySse).as("agentsStream"); } + function stubBoardBootstrap() { + // Some app bootstraps happen before we get to the /activity call. + // Keep these stable so the page always reaches the activity request. + cy.intercept("GET", `${apiBase}/organizations/me/member*`, { + statusCode: 200, + body: { organization_id: "org1", role: "owner" }, + }).as("orgMeMember"); + + cy.intercept("GET", `${apiBase}/boards*`, { + statusCode: 200, + body: { + items: [{ id: "b1", name: "Testing", updated_at: "2026-02-07T00:00:00Z" }], + }, + }).as("boardsList"); + + cy.intercept("GET", `${apiBase}/boards/b1/snapshot*`, { + statusCode: 200, + body: { + tasks: [{ id: "t1", title: "CI hardening" }], + agents: [], + approvals: [], + chat_messages: [], + }, + }).as("boardSnapshot"); + } + function assertSignedInAndLanded() { cy.waitForAppLoaded(); cy.contains(/live feed/i).should("be.visible"); @@ -58,6 +84,8 @@ describe("/activity feed", () => { }); it("happy path: renders task comment cards", () => { + stubBoardBootstrap(); + cy.intercept("GET", "**/api/v1/activity**", { statusCode: 200, body: { @@ -94,6 +122,8 @@ describe("/activity feed", () => { }); it("empty state: shows waiting message when no items", () => { + stubBoardBootstrap(); + cy.intercept("GET", "**/api/v1/activity**", { statusCode: 200, body: { items: [] }, @@ -113,6 +143,8 @@ describe("/activity feed", () => { }); it("error state: shows failure UI when API errors", () => { + stubBoardBootstrap(); + cy.intercept("GET", "**/api/v1/activity**", { statusCode: 500, body: { detail: "boom" },