refactor: 整理品牌配置与小程序编辑工作区

This commit is contained in:
que01 committed 2026-10-10 10:20:14 +08:00
1 parent 849ae5df05
commit a2932b1134
13 files changed
+416 -63

No files matched your search

+16 -1
View File
@@ -332,6 +332,20 @@ test("Admin 按通用预览目标筛选字段并同步品牌草稿", async ({ pa
await expect(page.getByText("小程序页面配置")).toBeVisible();
const preview = page.locator(".component-template-preview");
await expect(preview.locator(".food-home .name")).toContainText("测试主理人");
await expect(page.getByText("选择要编辑的区域", { exact: true })).toBeVisible();
for (const width of [1920, 1280, 1024, 768, 390]) {
await page.setViewportSize({ width, height: 1000 });
const editor = page.locator(".presentation-editor");
await editor.scrollIntoViewIfNeeded();
await expect
.poll(() => editor.evaluate((element) => element.scrollWidth - element.clientWidth))
.toBeLessThanOrEqual(1);
await editor.screenshot({
path: "../../.codex-tasks/admin-editor-workspace/raw/editor-" + width + ".png",
});
}
await page.setViewportSize({ width: 1920, height: 1000 });
await page.getByRole("button", { name: "选择品牌信息区" }).click();
await expect(preview.locator(".component-template-preview__outline.is-selected")).toHaveAttribute(
"data-selected-target",
@@ -455,6 +469,7 @@ test("Admin 按通用预览目标筛选字段并同步品牌草稿", async ({ pa
await expect(preview.locator(".food-detail .bar button")).toBeVisible();
await preview.screenshot({ path: "../../.codex-tasks/preview-proportion/detail.png" });
await expect(page.getByText("详情页由所选业务内容动态生成")).toBeVisible();
await expect(page.getByRole("button", { name: "点选编辑" })).toHaveCount(0);
await expect(page.getByLabel("价格标题")).toHaveCount(0);
await expect(page.getByLabel("餐品介绍")).toHaveCount(0);
await page.getByText("定制/咨询", { exact: true }).click();
@@ -478,8 +493,8 @@ test("Admin 按通用预览目标筛选字段并同步品牌草稿", async ({ pa
await page.getByText("记录页", { exact: true }).click();
await expect(preview.locator(".records-page")).toBeVisible();
await expect(preview.locator(".records-page")).toContainText("请在微信小程序内登录查看");
await page.getByRole("button", { name: "点选编辑" }).click();
await page.getByText("套餐餐品", { exact: true }).click();
await page.getByRole("button", { name: "点选编辑" }).click();
await expect
.poll(() =>
preview.locator(".dish-media img").evaluate((image: HTMLImageElement) => image.naturalWidth),