test(auto-reply): dedupe directive behavior e2e fixtures

This commit is contained in:
Peter Steinberger
2026-02-18 12:20:40 +00:00
parent 3c886ee98b
commit 2fd211b705
6 changed files with 185 additions and 348 deletions

View File

@@ -36,6 +36,20 @@ export function replyTexts(res: ReplyPayloadText | ReplyPayloadText[]): string[]
.filter((value): value is string => Boolean(value));
}
export function makeEmbeddedTextResult(text = "done") {
return {
payloads: [{ text }],
meta: {
durationMs: 5,
agentMeta: { sessionId: "s", provider: "p", model: "m" },
},
};
}
export function mockEmbeddedTextResult(text = "done") {
vi.mocked(runEmbeddedPiAgent).mockResolvedValue(makeEmbeddedTextResult(text));
}
export async function withTempHome<T>(fn: (home: string) => Promise<T>): Promise<T> {
return withTempHomeBase(
async (home) => {