feat(P1④/P1⑤): 改表加列UI + 审批列表入口e2e

- P1④ 改表加列: meta.ts alterEntity(POST /api/meta/entity/{table}/attributes)
  + ModelerPage 行内「加字段」Dialog(复用FieldTable),打破"v1只建新不改表"
  + five-ring.spec.ts 新增"改已有表加列(建模器加字段→元数据落库)"浏览器e2e
- P1⑤ 审批列表入口: 新增 approval-list-entry.spec.ts(纯mock)验生产主路径
  转换列表页按钮→选中行(checkOnItemClick)→openApprovalDrawer→AppShell→ApprovalDrawer抽屉打开
- build绿+vitest73;fivering 5/5 + 审批入口 1/1 全绿

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-21 13:56:27 +08:00
parent d1fd6ed956
commit 5b117df4d1
4 changed files with 235 additions and 3 deletions

View File

@@ -108,6 +108,49 @@ test('人走五环 · 浏览器全程点穿(amis wizard:建实体 → 生成
}, { timeout: 20_000, message: '发布后菜单树应出现 design-<table> 节点' }).toBeGreaterThan(0);
});
// P1④ 人走五环 v2:给已有实体「加字段」(受控 ALTER) —— 建模器 /modeler 行内入口。
// 前置 API 建实体 → 浏览器走加字段 UI → 断言元数据落库(物理列由 scripts/p0-alter-acceptance.sh 的 psql 证)。
test('人走五环 v2 · 改已有表加列(建模器加字段 → 元数据落库)', async ({ page }) => {
test.setTimeout(120_000);
const ALTER_TABLE = `EIP4PT_PWALT${Date.now()}`;
const tok = await adminToken();
const created = await apiJson('POST', '/api/meta/entity', tok, {
tablename: ALTER_TABLE, name: '改表演示',
attributes: [{ column: 'TITLE', display: '标题', type: 'string', length: 100, mandatory: true }],
});
expect(created.status).toBe(200);
// 登录
await page.goto('/login');
await page.getByRole('textbox').first().fill('admin');
await page.locator('input[type="password"]').fill('111111');
await page.getByRole('button', { name: '登录' }).click();
await page.waitForURL((u) => !u.pathname.endsWith('/login'), { timeout: 15_000 });
// 建模器 → 定位该实体行 → 加字段
await page.goto('/modeler');
const row = page.getByTestId('modeler-entity-row').filter({ hasText: ALTER_TABLE });
await expect(row).toBeVisible({ timeout: 15_000 });
await row.getByTestId('modeler-add-field').click();
// 加字段 Dialog:FieldTable 加一列 AMOUNT(小数)
await page.getByTestId('field-add').click();
await page.getByTestId('field-column').fill('AMOUNT');
await page.getByTestId('field-display').fill('金额');
await page.getByTestId('field-type').selectOption('小数');
await page.getByTestId('field-submit').click(); // 行入表
await expect(page.getByTestId('field-row')).toBeVisible();
await page.getByTestId('modeler-alter-submit').click(); // 提交 ALTER
// 断言:加字段后元数据出现 AMOUNT(物理列生效由 psql 验收脚本另证)
await expect.poll(async () => {
const r = await apiJson('GET', `/api/meta/entity/${ALTER_TABLE}/attributes`, tok);
return (r.json?.data?.columns || []).map((c: { column: string }) => c.column);
}, { timeout: 15_000, message: '加字段后元数据应含 AMOUNT' }).toContain('AMOUNT');
await apiJson('DELETE', `/api/meta/entity/${ALTER_TABLE}`, tok);
});
// 注:AI ①面 amis form 的渲染已人工 live 验证(截图 + 提交按钮),其 READY_FOR_HUMAN_REVIEW
// 后端链路由 curl e2e 证(status=READY + PAGE_SCHEMA.targetId,见 scripts/five-ring-acceptance.sh)。
// 不在此自动化 AI 全程:auto-develop 的 localApply/smoke 以 baseUrl 回调,dev 经 5174→8094 代理回跳时