| ... | ... | @@ -10,7 +10,7 @@ import { |
| 10 | 10 | } from "@t3tools/contracts"; |
| 11 | 11 | import { describe, expect, it } from "vite-plus/test"; |
| 12 | 12 | |
| 13 | | import { buildThreadFeed } from "../../mobile/src/lib/threadActivity.ts"; |
| 13 | import { buildThreadFeed, type ThreadFeedActivity } from "../../mobile/src/lib/threadActivity.ts"; |
| 14 | 14 | import { deriveWorkLogEntries } from "../../web/src/session-logic.ts"; |
| 15 | 15 | import { |
| 16 | 16 | projectActivityEvent, |
| ... | ... | @@ -134,6 +134,27 @@ const fixtures = [ |
| 134 | 134 | ] satisfies ReadonlyArray<OrchestrationThreadActivity>; |
| 135 | 135 | |
| 136 | 136 | describe("projectActivityPayload", () => { |
| 137 | function comparableActivity(activity: ThreadFeedActivity) { |
| 138 | return { |
| 139 | ...activity, |
| 140 | fullDetail: activity.getFullDetail(), |
| 141 | copyText: activity.getCopyText(), |
| 142 | getFullDetail: undefined, |
| 143 | getCopyText: undefined, |
| 144 | }; |
| 145 | } |
| 146 | |
| 147 | function comparableThreadFeed(activities: ReadonlyArray<OrchestrationThreadActivity>) { |
| 148 | return buildThreadFeed(makeThread(activities)).map((entry) => |
| 149 | entry.type === "activity-group" |
| 150 | ? { |
| 151 | ...entry, |
| 152 | activities: entry.activities.map(comparableActivity), |
| 153 | } |
| 154 | : entry, |
| 155 | ); |
| 156 | } |
| 157 | |
| 137 | 158 | it("drops unread bulk while retaining command, file, tool, and summary inputs", () => { |
| 138 | 159 | const projected = projectActivityPayload(fixtures[0]!); |
| 139 | 160 | expect(projected.payload).toEqual({ |
| ... | ... | @@ -170,9 +191,7 @@ describe("projectActivityPayload", () => { |
| 170 | 191 | for (const activity of fixtures) { |
| 171 | 192 | const projected = projectActivityPayload(activity); |
| 172 | 193 | expect(deriveWorkLogEntries([projected])).toEqual(deriveWorkLogEntries([activity])); |
| 173 | | expect(buildThreadFeed(makeThread([projected]))).toEqual( |
| 174 | | buildThreadFeed(makeThread([activity])), |
| 175 | | ); |
| 194 | expect(comparableThreadFeed([projected])).toEqual(comparableThreadFeed([activity])); |
| 176 | 195 | } |
| 177 | 196 | }); |
| 178 | 197 | |