Skip to content

Commit dbb177d

Browse files
fix(mobile): rebuild pending-move fixtures with the shared shell factory
The "hide subagent threads from v2 lists" change made getThreadListV2OrderedSection read thread.lineage, but the pending-move suite still hand-cast partial EnvironmentThreadShell rows, so all five cases crashed with "Cannot read properties of undefined". Build the rows through makeThreadShellFixture so the fixtures track every field the shared section helper reads; assertions are unchanged. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com> (cherry picked from commit 5af8ea3)
1 parent 77d1d1d commit dbb177d

1 file changed

Lines changed: 9 additions & 11 deletions

File tree

‎apps/mobile/src/state/thread-order.test.ts‎

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import type { Atom } from "effect/unstable/reactivity";
44
import { afterEach, describe, expect, it, vi } from "vite-plus/test";
55

66
import { createPendingThreadOrder } from "../features/threads/threadOrder";
7+
import { makeThreadShellFixture } from "../test-fixtures";
78
import { appAtomRegistry } from "./atom-registry";
89
import {
910
beginPendingThreadOrder,
@@ -36,17 +37,14 @@ const shellsAtom = environmentThreadShells.threadShellsAtom as Atom.Writable<
3637
>;
3738

3839
function fixture() {
39-
// Only section membership and order fields are read by this coordinator.
40-
const rows = ["a", "b"].map(
41-
(id, index) =>
42-
({
43-
id: ThreadId.make(id),
44-
environmentId: EnvironmentId.make("env"),
45-
createdAt: `2026-06-01T0${2 - index}:00:00.000Z`,
46-
archivedAt: null,
47-
pinnedAt: null,
48-
activeOrderKey: null,
49-
}) as EnvironmentThreadShell,
40+
// The shared section helper also reads lineage/settled/snooze fields, so
41+
// partial casts break when it grows — build complete shells instead.
42+
const rows = ["a", "b"].map((id, index) =>
43+
makeThreadShellFixture({
44+
id: ThreadId.make(id),
45+
environmentId: EnvironmentId.make("env"),
46+
createdAt: `2026-06-01T0${2 - index}:00:00.000Z`,
47+
}),
5048
);
5149
appAtomRegistry.set(shellsAtom, rows);
5250
const pending = createPendingThreadOrder({

0 commit comments

Comments
 (0)