Skip to content

armgit / alook

Public Imported from GitHub
0

Multi-Agent Collaboration for Team and Friends

test: stabilize forum sidebar activity fixture (#845)

Genere28fecffb3ab
diff --git a/src/web/src/hooks/community/use-forum-sidebar-threads.dom.test.ts b/src/web/src/hooks/community/use-forum-sidebar-threads.dom.test.ts
index d2df04322..181b44a05 100644
--- a/src/web/src/hooks/community/use-forum-sidebar-threads.dom.test.ts
+++ b/src/web/src/hooks/community/use-forum-sidebar-threads.dom.test.ts
@@ -557,16 +557,17 @@ describe("forum sidebar canonical projection", () => {
it("folds in-flight title, activity, and removal deltas into one canonical publish", async () => {
const { queryClient, wrapper } = await setup()
+ const activityAt = new Date(Date.now() - 60_000).toISOString()
let resolveRequest!: (value: SidebarThreadEnvelope) => void
apiFetchMock.mockReturnValue(new Promise((resolve) => { resolveRequest = resolve }))
const rendered = renderHook(() => useForumSidebarThreads("server-1", null), { wrapper })
await waitFor(() => expect(apiFetchMock).toHaveBeenCalledOnce())
patchForumSidebarTitleExact(queryClient, "server-1", "post-1", "live title")
patchForumSidebarActivityExact(
- queryClient, "server-1", "post-1", "forum-1", "2026-09-26T10:00:00.000Z",
+ queryClient, "server-1", "post-1", "forum-1", activityAt,
)
patchForumSidebarActivityExact(
- queryClient, "server-1", "missing", "forum-1", "2026-09-26T10:00:00.000Z",
+ queryClient, "server-1", "missing", "forum-1", activityAt,
)
removeForumSidebarThreadExact(queryClient, "server-1", "post-2")
await act(async () => resolveRequest(envelopeFor(["post-1", "post-2"])))
@@ -574,7 +575,7 @@ describe("forum sidebar canonical projection", () => {
expect.objectContaining({
id: "post-1",
title: "live title",
- activityAt: "2026-09-26T10:00:00.000Z",
+ activityAt,
}),
]))
expect(getCanonicalCommunityChannels(queryClient).some(({ id }) => id === "post-2"))