feat(workbench): integrate operational workflows and map state
This commit is contained in:
@@ -200,14 +200,18 @@ test("docked Agent respects forced color mode", async ({ page }) => {
|
||||
test("long history titles keep rename and explicit delete usable across viewport sizes", async ({
|
||||
page
|
||||
}) => {
|
||||
test.setTimeout(60_000);
|
||||
const sessionId = "browser-history-long-session";
|
||||
const originalTitle =
|
||||
"城南供水压力复核:夜间最小流量与压力变送器连续性联合调查,待现场反馈后人工审核";
|
||||
let title = originalTitle;
|
||||
let deleted = false;
|
||||
const writes: Array<{ method: string; path: string; body: unknown }> = [];
|
||||
await page.route("**/api/v1/agent/chat/sessions", (route) =>
|
||||
route.fulfill({
|
||||
await page.route(/\/api\/v1\/agent\/chat\/sessions(?:\?.*)?$/, (route) =>
|
||||
route.request().method() === "OPTIONS"
|
||||
? route.fallback()
|
||||
: route.fulfill({
|
||||
headers: { "Access-Control-Allow-Origin": "*" },
|
||||
json: {
|
||||
sessions: deleted
|
||||
? []
|
||||
@@ -226,17 +230,24 @@ test("long history titles keep rename and explicit delete usable across viewport
|
||||
await page.route("**/api/v1/agent/chat/session/**", async (route) => {
|
||||
const request = route.request();
|
||||
const method = request.method();
|
||||
if (method === "OPTIONS") return route.fallback();
|
||||
const path = new URL(request.url()).pathname;
|
||||
if (method === "PATCH" && path === `/api/v1/agent/chat/session/${sessionId}/title`) {
|
||||
const body = request.postDataJSON();
|
||||
title = body.title;
|
||||
writes.push({ method, path, body });
|
||||
return route.fulfill({ json: {} });
|
||||
return route.fulfill({
|
||||
headers: { "Access-Control-Allow-Origin": "*" },
|
||||
json: {}
|
||||
});
|
||||
}
|
||||
if (method === "DELETE" && path === `/api/v1/agent/chat/session/${sessionId}`) {
|
||||
deleted = true;
|
||||
writes.push({ method, path, body: null });
|
||||
return route.fulfill({ json: {} });
|
||||
return route.fulfill({
|
||||
headers: { "Access-Control-Allow-Origin": "*" },
|
||||
json: {}
|
||||
});
|
||||
}
|
||||
return route.fallback();
|
||||
});
|
||||
@@ -252,7 +263,7 @@ test("long history titles keep rename and explicit delete usable across viewport
|
||||
.click();
|
||||
const panel = page.getByRole("complementary", { name: "Agent 命令面板" });
|
||||
const modelButton = panel.getByRole("button", { name: "选择 Agent 模型" });
|
||||
await expect(modelButton).toBeVisible();
|
||||
await expect(modelButton).toBeVisible({ timeout: 10_000 });
|
||||
await expect(modelButton).toHaveAccessibleDescription("当前模型:测试模型");
|
||||
await expect(modelButton).toHaveAttribute("title", "测试模型");
|
||||
await waitForAnimations(panel);
|
||||
|
||||
Reference in New Issue
Block a user