{(node.error as Error).message}
+ ) : ( + <> +Не удалось загрузить результаты.
+ ) : processing.data.length === 0 ? ( +Пока нет результатов.
+ ) : ( +Нет данных.
+ ) : ( +{description}
+ {status ?+ Выделите один фрейм на холсте, чтобы отправить его на анализ. +
+{selectionVerdict.node.name}
+Готово к отправке
+{APP_VERSION}
+
+ }
+ description="Текущая версия приложения."
+ />
+ hi
\n```").text).toBe("hi
"); + }); + + it("unwraps a fence with no trailing newline before the closing fence", () => { + expect(extractText("```html\nhi
```").text).toBe("hi
"); + }); + + it("returns the trimmed whole when there is no single fence", () => { + expect(extractText(" just text ").text).toBe("just text"); + }); + + it("returns the whole when there are multiple fences (not a single block)", () => { + const raw = "```\na\n```\n```\nb\n```"; + expect(extractText(raw).text).toBe(raw); + }); +}); diff --git a/pixso-move/processor/tests/fakes.ts b/pixso-move/processor/tests/fakes.ts new file mode 100644 index 00000000000..6ad24ff8cc3 --- /dev/null +++ b/pixso-move/processor/tests/fakes.ts @@ -0,0 +1,129 @@ +import type { DesignerId, NodeId, ResultTag } from "@pixso-move/contracts"; +import * as Effect from "effect/Effect"; + +import { + AcpRunError, + type AcpRunnerShape, + type ClaimedJob, + type NodeForProcessing, + type ProcessorDeps, + type ReconcileRow, +} from "../src/types.ts"; + +export interface FakeResultRow { + id: string; + designerId: DesignerId; + nodeId: NodeId; + resultTag: ResultTag; + status: "pending" | "processing" | "done" | "error"; + attempts: number; + result: string | null; + error: string | null; +} + +export interface FakeState { + readonly nodeIdsByDesigner: Map