feat(maestro): spawn form rerolls from a fetched name batch (#53)

This commit is contained in:
Miguel Palhas
2026-08-23 21:15:33 +01:00
parent a970ba89c2
commit 818e0cc2db
7 changed files with 207 additions and 37 deletions
+5 -2
View File
@@ -15,7 +15,8 @@ function project(overrides: Partial<Project>): Project {
};
}
/** Two fetches gate the form's initial load: /api/info then /api/projects. */
/** Three fetches gate the form's initial load: /api/info, /api/projects, and
* the /api/names batch (#53). */
function stubFetch(info: unknown, projects: Project[]): void {
vi.stubGlobal(
"fetch",
@@ -25,7 +26,9 @@ function stubFetch(info: unknown, projects: Project[]): void {
? info
: url.includes("/api/projects")
? projects
: undefined;
: url.includes("/api/names")
? { names: ["allegro-cello", "presto-fugue", "adagio-lyre"] }
: undefined;
return new Response(JSON.stringify(body), { status: 200 });
}),
);