Open History to see the last commit
1import { scopeThreadRef } from "@t3tools/client-runtime";
2import {
3 EnvironmentId,
4 ProjectId,
5 ProviderDriverKind,
6 ProviderInstanceId,
7 ThreadId,
8 TurnId,
9} from "@t3tools/contracts";
10import { afterEach, describe, expect, it, vi } from "vitest";
11import { type EnvironmentState, useStore } from "../store";
12import { type Thread } from "../types";
13
14import {
15 MAX_HIDDEN_MOUNTED_TERMINAL_THREADS,
16 buildExpiredTerminalContextToastCopy,
17 createLocalDispatchSnapshot,
18 deriveComposerSendState,
19 hasServerAcknowledgedLocalDispatch,
20 reconcileMountedTerminalThreadIds,
21 resolveSendEnvMode,
22 shouldWriteThreadErrorToCurrentServerThread,
23 waitForStartedServerThread,
24} from "./ChatView.logic";
25
26const localEnvironmentId = EnvironmentId.make("environment-local");
27
28describe("deriveComposerSendState", () => {
29 it("treats expired terminal pills as non-sendable content", () => {
30 const state = deriveComposerSendState({
31 prompt: "\uFFFC",
32 imageCount: 0,
33 terminalContexts: [
34 {
35 id: "ctx-expired",
36 threadId: ThreadId.make("thread-1"),
37 terminalId: "default",
38 terminalLabel: "Terminal 1",
39 lineStart: 4,
40 lineEnd: 4,
41 text: "",
42 createdAt: "2026-03-17T12:52:29.000Z",
43 },
44 ],
45 });
46
47 expect(state.trimmedPrompt).toBe("");
48 expect(state.sendableTerminalContexts).toEqual([]);
49 expect(state.expiredTerminalContextCount).toBe(1);
50 expect(state.hasSendableContent).toBe(false);
51 });
52
53 it("keeps text sendable while excluding expired terminal pills", () => {
54 const state = deriveComposerSendState({
55 prompt: `yoo \uFFFC waddup`,
56 imageCount: 0,
57 terminalContexts: [
58 {
59 id: "ctx-expired",
60 threadId: ThreadId.make("thread-1"),
61 terminalId: "default",
62 terminalLabel: "Terminal 1",
63 lineStart: 4,
64 lineEnd: 4,
65 text: "",
66 createdAt: "2026-03-17T12:52:29.000Z",
67 },
68 ],
69 });
70
71 expect(state.trimmedPrompt).toBe("yoo waddup");
72 expect(state.expiredTerminalContextCount).toBe(1);
73 expect(state.hasSendableContent).toBe(true);
74 });
75});
76
77describe("buildExpiredTerminalContextToastCopy", () => {
78 it("formats clear empty-state guidance", () => {
79 expect(buildExpiredTerminalContextToastCopy(1, "empty")).toEqual({
80 title: "Expired terminal context won't be sent",
81 description: "Remove it or re-add it to include terminal output.",
82 });
83 });
84
85 it("formats omission guidance for sent messages", () => {
86 expect(buildExpiredTerminalContextToastCopy(2, "omitted")).toEqual({
87 title: "Expired terminal contexts omitted from message",
88 description: "Re-add it if you want that terminal output included.",
89 });
90 });
91});
92
93describe("resolveSendEnvMode", () => {
94 it("keeps worktree mode for git repositories", () => {
95 expect(resolveSendEnvMode({ requestedEnvMode: "worktree", isGitRepo: true })).toBe("worktree");
96 });
97
98 it("forces local mode for non-git repositories", () => {
99 expect(resolveSendEnvMode({ requestedEnvMode: "worktree", isGitRepo: false })).toBe("local");
100 expect(resolveSendEnvMode({ requestedEnvMode: "local", isGitRepo: false })).toBe("local");
101 });
102});
103
104describe("reconcileMountedTerminalThreadIds", () => {
105 it("keeps previously mounted open threads and adds the active open thread", () => {
106 expect(
107 reconcileMountedTerminalThreadIds({
108 currentThreadIds: [ThreadId.make("thread-hidden"), ThreadId.make("thread-stale")],
109 openThreadIds: [ThreadId.make("thread-hidden"), ThreadId.make("thread-active")],
110 activeThreadId: ThreadId.make("thread-active"),
111 activeThreadTerminalOpen: true,
112 }),
113 ).toEqual([ThreadId.make("thread-hidden"), ThreadId.make("thread-active")]);
114 });
115
116 it("drops mounted threads once their terminal drawer is no longer open", () => {
117 expect(
118 reconcileMountedTerminalThreadIds({
119 currentThreadIds: [ThreadId.make("thread-closed")],
120 openThreadIds: [],
121 activeThreadId: ThreadId.make("thread-closed"),
122 activeThreadTerminalOpen: false,
123 }),
124 ).toEqual([]);
125 });
126
127 it("keeps only the most recently active hidden terminal threads", () => {
128 expect(
129 reconcileMountedTerminalThreadIds({
130 currentThreadIds: [
131 ThreadId.make("thread-1"),
132 ThreadId.make("thread-2"),
133 ThreadId.make("thread-3"),
134 ],
135 openThreadIds: [
136 ThreadId.make("thread-1"),
137 ThreadId.make("thread-2"),
138 ThreadId.make("thread-3"),
139 ThreadId.make("thread-4"),
140 ],
141 activeThreadId: ThreadId.make("thread-4"),
142 activeThreadTerminalOpen: true,
143 maxHiddenThreadCount: 2,
144 }),
145 ).toEqual([ThreadId.make("thread-2"), ThreadId.make("thread-3"), ThreadId.make("thread-4")]);
146 });
147
148 it("moves the active thread to the end so it is treated as most recently used", () => {
149 expect(
150 reconcileMountedTerminalThreadIds({
151 currentThreadIds: [
152 ThreadId.make("thread-a"),
153 ThreadId.make("thread-b"),
154 ThreadId.make("thread-c"),
155 ],
156 openThreadIds: [
157 ThreadId.make("thread-a"),
158 ThreadId.make("thread-b"),
159 ThreadId.make("thread-c"),
160 ],
161 activeThreadId: ThreadId.make("thread-a"),
162 activeThreadTerminalOpen: true,
163 maxHiddenThreadCount: 2,
164 }),
165 ).toEqual([ThreadId.make("thread-b"), ThreadId.make("thread-c"), ThreadId.make("thread-a")]);
166 });
167
168 it("defaults to the hidden mounted terminal cap", () => {
169 const currentThreadIds = Array.from(
170 { length: MAX_HIDDEN_MOUNTED_TERMINAL_THREADS + 2 },
171 (_, index) => ThreadId.make(`thread-${index + 1}`),
172 );
173
174 expect(
175 reconcileMountedTerminalThreadIds({
176 currentThreadIds,
177 openThreadIds: currentThreadIds,
178 activeThreadId: null,
179 activeThreadTerminalOpen: false,
180 }),
181 ).toEqual(currentThreadIds.slice(-MAX_HIDDEN_MOUNTED_TERMINAL_THREADS));
182 });
183});
184
185describe("shouldWriteThreadErrorToCurrentServerThread", () => {
186 it("routes errors to the active server thread when route and target match", () => {
187 const threadId = ThreadId.make("thread-1");
188 const routeThreadRef = scopeThreadRef(localEnvironmentId, threadId);
189
190 expect(
191 shouldWriteThreadErrorToCurrentServerThread({
192 serverThread: {
193 environmentId: localEnvironmentId,
194 id: threadId,
195 },
196 routeThreadRef,
197 targetThreadId: threadId,
198 }),
199 ).toBe(true);
200 });
201
202 it("does not route draft-thread errors into server-backed state", () => {
203 const threadId = ThreadId.make("thread-1");
204
205 expect(
206 shouldWriteThreadErrorToCurrentServerThread({
207 serverThread: undefined,
208 routeThreadRef: scopeThreadRef(localEnvironmentId, threadId),
209 targetThreadId: threadId,
210 }),
211 ).toBe(false);
212 });
213});
214
215const makeThread = (input?: {
216 id?: ThreadId;
217 latestTurn?: {
218 turnId: TurnId;
219 state: "running" | "completed";
220 requestedAt: string;
221 startedAt: string | null;
222 completedAt: string | null;
223 } | null;
224}): Thread => ({
225 id: input?.id ?? ThreadId.make("thread-1"),
226 environmentId: localEnvironmentId,
227 codexThreadId: null,
228 projectId: ProjectId.make("project-1"),
229 title: "Thread",
230 modelSelection: { instanceId: ProviderInstanceId.make("codex"), model: "gpt-5.4" },
231 runtimeMode: "full-access" as const,
232 interactionMode: "default" as const,
233 session: null,
234 messages: [],
235 proposedPlans: [],
236 error: null,
237 createdAt: "2026-03-29T00:00:00.000Z",
238 archivedAt: null,
239 updatedAt: "2026-03-29T00:00:00.000Z",
240 latestTurn: input?.latestTurn
241 ? {
242 ...input.latestTurn,
243 assistantMessageId: null,
244 }
245 : null,
246 branch: null,
247 worktreePath: null,
248 turnDiffSummaries: [],
249 activities: [],
250});
251
252function setStoreThreads(threads: ReadonlyArray<ReturnType<typeof makeThread>>) {
253 const projectId = ProjectId.make("project-1");
254 const environmentState: EnvironmentState = {
255 projectIds: [projectId],
256 projectById: {
257 [projectId]: {
258 id: projectId,
259 environmentId: localEnvironmentId,
260 name: "Project",
261 cwd: "/tmp/project",
262 defaultModelSelection: {
263 instanceId: ProviderInstanceId.make("codex"),
264 model: "gpt-5.4",
265 },
266 createdAt: "2026-03-29T00:00:00.000Z",
267 updatedAt: "2026-03-29T00:00:00.000Z",
268 scripts: [],
269 },
270 },
271 threadIds: threads.map((thread) => thread.id),
272 threadIdsByProjectId: {
273 [projectId]: threads.map((thread) => thread.id),
274 },
275 threadShellById: Object.fromEntries(
276 threads.map((thread) => [
277 thread.id,
278 {
279 id: thread.id,
280 environmentId: thread.environmentId,
281 codexThreadId: thread.codexThreadId,
282 projectId: thread.projectId,
283 title: thread.title,
284 modelSelection: thread.modelSelection,
285 runtimeMode: thread.runtimeMode,
286 interactionMode: thread.interactionMode,
287 error: thread.error,
288 createdAt: thread.createdAt,
289 archivedAt: thread.archivedAt,
290 updatedAt: thread.updatedAt,
291 branch: thread.branch,
292 worktreePath: thread.worktreePath,
293 },
294 ]),
295 ),
296 threadSessionById: Object.fromEntries(threads.map((thread) => [thread.id, thread.session])),
297 threadTurnStateById: Object.fromEntries(
298 threads.map((thread) => [
299 thread.id,
300 {
301 latestTurn: thread.latestTurn,
302 ...(thread.pendingSourceProposedPlan
303 ? { pendingSourceProposedPlan: thread.pendingSourceProposedPlan }
304 : {}),
305 },
306 ]),
307 ),
308 messageIdsByThreadId: Object.fromEntries(
309 threads.map((thread) => [thread.id, thread.messages.map((message) => message.id)]),
310 ),
311 messageByThreadId: Object.fromEntries(
312 threads.map((thread) => [
313 thread.id,
314 Object.fromEntries(thread.messages.map((message) => [message.id, message])),
315 ]),
316 ),
317 activityIdsByThreadId: Object.fromEntries(
318 threads.map((thread) => [thread.id, thread.activities.map((activity) => activity.id)]),
319 ),
320 activityByThreadId: Object.fromEntries(
321 threads.map((thread) => [
322 thread.id,
323 Object.fromEntries(thread.activities.map((activity) => [activity.id, activity])),
324 ]),
325 ),
326 proposedPlanIdsByThreadId: Object.fromEntries(
327 threads.map((thread) => [thread.id, thread.proposedPlans.map((plan) => plan.id)]),
328 ),
329 proposedPlanByThreadId: Object.fromEntries(
330 threads.map((thread) => [
331 thread.id,
332 Object.fromEntries(thread.proposedPlans.map((plan) => [plan.id, plan])),
333 ]),
334 ),
335 turnDiffIdsByThreadId: Object.fromEntries(
336 threads.map((thread) => [
337 thread.id,
338 thread.turnDiffSummaries.map((summary) => summary.turnId),
339 ]),
340 ),
341 turnDiffSummaryByThreadId: Object.fromEntries(
342 threads.map((thread) => [
343 thread.id,
344 Object.fromEntries(thread.turnDiffSummaries.map((summary) => [summary.turnId, summary])),
345 ]),
346 ),
347 sidebarThreadSummaryById: {},
348 bootstrapComplete: true,
349 };
350 useStore.setState({
351 activeEnvironmentId: localEnvironmentId,
352 environmentStateById: {
353 [localEnvironmentId]: environmentState,
354 },
355 });
356}
357
358afterEach(() => {
359 vi.useRealTimers();
360 vi.restoreAllMocks();
361 setStoreThreads([]);
362});
363
364describe("waitForStartedServerThread", () => {
365 it("resolves immediately when the thread is already started", async () => {
366 const threadId = ThreadId.make("thread-started");
367 setStoreThreads([
368 makeThread({
369 id: threadId,
370 latestTurn: {
371 turnId: TurnId.make("turn-started"),
372 state: "running",
373 requestedAt: "2026-03-29T00:00:01.000Z",
374 startedAt: "2026-03-29T00:00:01.000Z",
375 completedAt: null,
376 },
377 }),
378 ]);
379
380 await expect(
381 waitForStartedServerThread(scopeThreadRef(localEnvironmentId, threadId)),
382 ).resolves.toBe(true);
383 });
384
385 it("waits for the thread to start via subscription updates", async () => {
386 const threadId = ThreadId.make("thread-wait");
387 setStoreThreads([makeThread({ id: threadId })]);
388
389 const promise = waitForStartedServerThread(scopeThreadRef(localEnvironmentId, threadId), 500);
390
391 setStoreThreads([
392 makeThread({
393 id: threadId,
394 latestTurn: {
395 turnId: TurnId.make("turn-started"),
396 state: "running",
397 requestedAt: "2026-03-29T00:00:01.000Z",
398 startedAt: "2026-03-29T00:00:01.000Z",
399 completedAt: null,
400 },
401 }),
402 ]);
403
404 await expect(promise).resolves.toBe(true);
405 });
406
407 it("handles the thread starting between the initial read and subscription setup", async () => {
408 const threadId = ThreadId.make("thread-race");
409 setStoreThreads([makeThread({ id: threadId })]);
410
411 const originalSubscribe = useStore.subscribe.bind(useStore);
412 let raced = false;
413 vi.spyOn(useStore, "subscribe").mockImplementation((listener) => {
414 if (!raced) {
415 raced = true;
416 setStoreThreads([
417 makeThread({
418 id: threadId,
419 latestTurn: {
420 turnId: TurnId.make("turn-race"),
421 state: "running",
422 requestedAt: "2026-03-29T00:00:01.000Z",
423 startedAt: "2026-03-29T00:00:01.000Z",
424 completedAt: null,
425 },
426 }),
427 ]);
428 }
429 return originalSubscribe(listener);
430 });
431
432 await expect(
433 waitForStartedServerThread(scopeThreadRef(localEnvironmentId, threadId), 500),
434 ).resolves.toBe(true);
435 });
436
437 it("returns false after the timeout when the thread never starts", async () => {
438 vi.useFakeTimers();
439
440 const threadId = ThreadId.make("thread-timeout");
441 setStoreThreads([makeThread({ id: threadId })]);
442 const promise = waitForStartedServerThread(scopeThreadRef(localEnvironmentId, threadId), 500);
443
444 await vi.advanceTimersByTimeAsync(500);
445
446 await expect(promise).resolves.toBe(false);
447 });
448});
449
450describe("hasServerAcknowledgedLocalDispatch", () => {
451 const projectId = ProjectId.make("project-1");
452 const previousLatestTurn = {
453 turnId: TurnId.make("turn-1"),
454 state: "completed" as const,
455 requestedAt: "2026-03-29T00:00:00.000Z",
456 startedAt: "2026-03-29T00:00:01.000Z",
457 completedAt: "2026-03-29T00:00:10.000Z",
458 assistantMessageId: null,
459 };
460
461 const previousSession = {
462 provider: ProviderDriverKind.make("codex"),
463 status: "ready" as const,
464 createdAt: "2026-03-29T00:00:00.000Z",
465 updatedAt: "2026-03-29T00:00:10.000Z",
466 orchestrationStatus: "idle" as const,
467 };
468
469 it("does not clear local dispatch before server state changes", () => {
470 const localDispatch = createLocalDispatchSnapshot({
471 id: ThreadId.make("thread-1"),
472 environmentId: localEnvironmentId,
473 codexThreadId: null,
474 projectId,
475 title: "Thread",
476 modelSelection: { instanceId: ProviderInstanceId.make("codex"), model: "gpt-5.4" },
477 runtimeMode: "full-access",
478 interactionMode: "default",
479 session: previousSession,
480 messages: [],
481 proposedPlans: [],
482 error: null,
483 createdAt: "2026-03-29T00:00:00.000Z",
484 archivedAt: null,
485 updatedAt: "2026-03-29T00:00:10.000Z",
486 latestTurn: previousLatestTurn,
487 branch: null,
488 worktreePath: null,
489 turnDiffSummaries: [],
490 activities: [],
491 });
492
493 expect(
494 hasServerAcknowledgedLocalDispatch({
495 localDispatch,
496 phase: "ready",
497 latestTurn: previousLatestTurn,
498 session: previousSession,
499 hasPendingApproval: false,
500 hasPendingUserInput: false,
501 threadError: null,
502 }),
503 ).toBe(false);
504 });
505
506 it("clears local dispatch when a new turn is already settled", () => {
507 const localDispatch = createLocalDispatchSnapshot({
508 id: ThreadId.make("thread-1"),
509 environmentId: localEnvironmentId,
510 codexThreadId: null,
511 projectId,
512 title: "Thread",
513 modelSelection: { instanceId: ProviderInstanceId.make("codex"), model: "gpt-5.4" },
514 runtimeMode: "full-access",
515 interactionMode: "default",
516 session: previousSession,
517 messages: [],
518 proposedPlans: [],
519 error: null,
520 createdAt: "2026-03-29T00:00:00.000Z",
521 archivedAt: null,
522 updatedAt: "2026-03-29T00:00:10.000Z",
523 latestTurn: previousLatestTurn,
524 branch: null,
525 worktreePath: null,
526 turnDiffSummaries: [],
527 activities: [],
528 });
529
530 expect(
531 hasServerAcknowledgedLocalDispatch({
532 localDispatch,
533 phase: "ready",
534 latestTurn: {
535 ...previousLatestTurn,
536 turnId: TurnId.make("turn-2"),
537 requestedAt: "2026-03-29T00:01:00.000Z",
538 startedAt: "2026-03-29T00:01:01.000Z",
539 completedAt: "2026-03-29T00:01:30.000Z",
540 },
541 session: {
542 ...previousSession,
543 updatedAt: "2026-03-29T00:01:30.000Z",
544 },
545 hasPendingApproval: false,
546 hasPendingUserInput: false,
547 threadError: null,
548 }),
549 ).toBe(true);
550 });
551
552 it("does not clear local dispatch while the session is running a newer turn than latestTurn", () => {
553 const localDispatch = createLocalDispatchSnapshot({
554 id: ThreadId.make("thread-1"),
555 environmentId: localEnvironmentId,
556 codexThreadId: null,
557 projectId,
558 title: "Thread",
559 modelSelection: { instanceId: ProviderInstanceId.make("codex"), model: "gpt-5.4" },
560 runtimeMode: "full-access",
561 interactionMode: "default",
562 session: previousSession,
563 messages: [],
564 proposedPlans: [],
565 error: null,
566 createdAt: "2026-03-29T00:00:00.000Z",
567 archivedAt: null,
568 updatedAt: "2026-03-29T00:00:10.000Z",
569 latestTurn: previousLatestTurn,
570 branch: null,
571 worktreePath: null,
572 turnDiffSummaries: [],
573 activities: [],
574 });
575
576 expect(
577 hasServerAcknowledgedLocalDispatch({
578 localDispatch,
579 phase: "running",
580 latestTurn: previousLatestTurn,
581 session: {
582 ...previousSession,
583 status: "running",
584 orchestrationStatus: "running",
585 activeTurnId: TurnId.make("turn-2"),
586 updatedAt: "2026-03-29T00:01:00.000Z",
587 },
588 hasPendingApproval: false,
589 hasPendingUserInput: false,
590 threadError: null,
591 }),
592 ).toBe(false);
593 });
594
595 it("does not clear local dispatch while the session is running but latestTurn has not advanced yet", () => {
596 const localDispatch = createLocalDispatchSnapshot({
597 id: ThreadId.make("thread-1"),
598 environmentId: localEnvironmentId,
599 codexThreadId: null,
600 projectId,
601 title: "Thread",
602 modelSelection: { instanceId: ProviderInstanceId.make("codex"), model: "gpt-5.4" },
603 runtimeMode: "full-access",
604 interactionMode: "default",
605 session: previousSession,
606 messages: [],
607 proposedPlans: [],
608 error: null,
609 createdAt: "2026-03-29T00:00:00.000Z",
610 archivedAt: null,
611 updatedAt: "2026-03-29T00:00:10.000Z",
612 latestTurn: previousLatestTurn,
613 branch: null,
614 worktreePath: null,
615 turnDiffSummaries: [],
616 activities: [],
617 });
618
619 expect(
620 hasServerAcknowledgedLocalDispatch({
621 localDispatch,
622 phase: "running",
623 latestTurn: previousLatestTurn,
624 session: {
625 ...previousSession,
626 status: "running",
627 orchestrationStatus: "running",
628 activeTurnId: undefined,
629 updatedAt: "2026-03-29T00:01:00.000Z",
630 },
631 hasPendingApproval: false,
632 hasPendingUserInput: false,
633 threadError: null,
634 }),
635 ).toBe(false);
636 });
637
638 it("clears local dispatch once the running latestTurn matches the active session turn", () => {
639 const localDispatch = createLocalDispatchSnapshot({
640 id: ThreadId.make("thread-1"),
641 environmentId: localEnvironmentId,
642 codexThreadId: null,
643 projectId,
644 title: "Thread",
645 modelSelection: { instanceId: ProviderInstanceId.make("codex"), model: "gpt-5.4" },
646 runtimeMode: "full-access",
647 interactionMode: "default",
648 session: previousSession,
649 messages: [],
650 proposedPlans: [],
651 error: null,
652 createdAt: "2026-03-29T00:00:00.000Z",
653 archivedAt: null,
654 updatedAt: "2026-03-29T00:00:10.000Z",
655 latestTurn: previousLatestTurn,
656 branch: null,
657 worktreePath: null,
658 turnDiffSummaries: [],
659 activities: [],
660 });
661
662 expect(
663 hasServerAcknowledgedLocalDispatch({
664 localDispatch,
665 phase: "running",
666 latestTurn: {
667 ...previousLatestTurn,
668 turnId: TurnId.make("turn-2"),
669 state: "running",
670 requestedAt: "2026-03-29T00:01:00.000Z",
671 startedAt: "2026-03-29T00:01:01.000Z",
672 completedAt: null,
673 },
674 session: {
675 ...previousSession,
676 status: "running",
677 orchestrationStatus: "running",
678 activeTurnId: TurnId.make("turn-2"),
679 updatedAt: "2026-03-29T00:01:01.000Z",
680 },
681 hasPendingApproval: false,
682 hasPendingUserInput: false,
683 threadError: null,
684 }),
685 ).toBe(true);
686 });
687
688 it("clears local dispatch when the session changes without an observed running phase", () => {
689 const localDispatch = createLocalDispatchSnapshot({
690 id: ThreadId.make("thread-1"),
691 environmentId: localEnvironmentId,
692 codexThreadId: null,
693 projectId,
694 title: "Thread",
695 modelSelection: { instanceId: ProviderInstanceId.make("codex"), model: "gpt-5.4" },
696 runtimeMode: "full-access",
697 interactionMode: "default",
698 session: previousSession,
699 messages: [],
700 proposedPlans: [],
701 error: null,
702 createdAt: "2026-03-29T00:00:00.000Z",
703 archivedAt: null,
704 updatedAt: "2026-03-29T00:00:10.000Z",
705 latestTurn: previousLatestTurn,
706 branch: null,
707 worktreePath: null,
708 turnDiffSummaries: [],
709 activities: [],
710 });
711
712 expect(
713 hasServerAcknowledgedLocalDispatch({
714 localDispatch,
715 phase: "ready",
716 latestTurn: previousLatestTurn,
717 session: {
718 ...previousSession,
719 updatedAt: "2026-03-29T00:00:11.000Z",
720 },
721 hasPendingApproval: false,
722 hasPendingUserInput: false,
723 threadError: null,
724 }),
725 ).toBe(true);
726 });
727});