test(canvas): restore My Works fixture after project ID changes
This commit is contained in:
1 parent
4320c6fc51
commit
ab864306ce
2 files changed
+3
No files matched your search
@@ -18,6 +18,8 @@ export async function createCanvasMyWorksServer({ port = 0 } = {}) {
|
||||
export const IMAGE_WORKSPACE_CREATE_PROJECT_EVENT = 'qa:image-workspace:create-project';
|
||||
export class ImageWorkspaceApiError extends Error {}
|
||||
export const createImageWorkspaceOperationId = () => 'qa-operation';
|
||||
let projectSequence = 0;
|
||||
export const createImageWorkspaceProjectId = () => 'qa-workspace-created-' + ++projectSequence;
|
||||
export const fetchImageWorkspace = async () => structuredClone(fixtureBootstrap);
|
||||
export const fetchImageWorkspaceProject = async id => {
|
||||
const workspace = fixtureWorkspaces.find(workspace => workspace.workspace.workspaceId === id);
|
||||
|
||||
@@ -22,6 +22,7 @@ for (const viewport of [{ width: 1600, height: 1000 }, { width: 1440, height: 96
|
||||
});
|
||||
await page.setViewportSize(viewport);
|
||||
await page.goto(baseUrl);
|
||||
expect(pageErrors, 'Canvas fixture must initialize without module or browser errors').toEqual([]);
|
||||
const split = page.getByTestId('canvas-workspace-split');
|
||||
await expect(split).toBeVisible();
|
||||
if (viewport.width >= 1024) await page.getByRole('button', { name: '展开创作对话', exact: true }).click();
|
||||
|
||||
Reference in new issue
Block a user