fix(storybook): isolate project workspace queries
Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
parent
0bed8c643d
commit
bd4b566f96
|
|
@ -23,6 +23,17 @@ function operation(
|
|||
}
|
||||
|
||||
describe("work-folder Storybook fixtures", () => {
|
||||
it("handles the project page's workspace query without a backend", async () => {
|
||||
const fixture = createWorkFolderFixture();
|
||||
const response = await fixture.handle(
|
||||
new Request(
|
||||
"http://storybook.test/api/companies/company-storybook/execution-workspaces?projectId=project-board-ui",
|
||||
),
|
||||
);
|
||||
expect(response!.status).toBe(200);
|
||||
expect(await response!.json()).toEqual([]);
|
||||
});
|
||||
|
||||
it("keeps uploads within one owner and resets them for the next story", async () => {
|
||||
const fixture = createWorkFolderFixture("empty");
|
||||
const bytes = new Uint8Array([0, 255, 128, 10]);
|
||||
|
|
|
|||
|
|
@ -128,6 +128,14 @@ export function createWorkFolderFixture(
|
|||
}
|
||||
async function handle(request: Request): Promise<Response | null> {
|
||||
const url = new URL(request.url);
|
||||
// ProjectDetail loads this list even when its Files dialog is the review focus.
|
||||
if (
|
||||
request.method === "GET" &&
|
||||
url.pathname ===
|
||||
`/api/companies/${WORK_FOLDER_COMPANY}/execution-workspaces`
|
||||
) {
|
||||
return Response.json([]);
|
||||
}
|
||||
const match = url.pathname.match(
|
||||
/^\/api\/companies\/company-storybook\/work-folders\/(task|agent|user|project)\/([^/]+)(?:\/(content|operations|sync|refresh))?$/,
|
||||
);
|
||||
|
|
|
|||
Loading…
Reference in New Issue