feat: complete TASK-WP4-02 canvas element editing

This commit is contained in:
suyx
2026-08-03 10:58:17 +08:00
parent 8d8fbeb816
commit d16802c164
11 changed files with 1314 additions and 67 deletions
+13 -1
View File
@@ -2,14 +2,26 @@ import { mkdirSync } from "node:fs";
import { dirname, resolve } from "node:path";
import { expect, test } from "@playwright/test";
import { createServer, type ViteDevServer } from "vite";
const webUrl = "http://127.0.0.1:4173";
let vite: ViteDevServer;
let webUrl: string;
const userId = "00000000-0000-4000-8000-000000000701";
const taskId = "00000000-0000-4000-8000-000000000702";
const projectId = "00000000-0000-4000-8000-000000000703";
test.use({ trace: "off" });
test.beforeAll(async () => {
vite = await createServer({ configFile: resolve("apps/web/vite.config.ts"), root: resolve("apps/web"), server: { host: "127.0.0.1", port: 0 } });
await vite.listen();
const address = vite.httpServer?.address();
if (!address || typeof address === "string") throw new Error("Vite did not expose a test port.");
webUrl = `http://127.0.0.1:${address.port}`;
});
test.afterAll(async () => vite.close());
const session = {
audience: "user", authenticated: true,
credits: { available_balance: 9, reserved_balance: 1 },