feat(maestro): spawn form rerolls from a fetched name batch (#53)
This commit is contained in:
@@ -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 });
|
||||
}),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user