test: verify complex entry edits in workbench
This commit is contained in:
1 parent
067c0e370d
commit
858db529ae
2 files changed
+41
No files matched your search
@@ -89,6 +89,8 @@ complex-junction.js / native-road.js:构建与全部消费者;direct-edit-so
|
||||
|
||||
后续已补齐该缺口:方向手柄发布有效内断面中心和旋转半径,客户端按最短方位角变化生成 `offsetDegrees`,ghost 沿圆周移动并显示角度;位置、方向和宽度手柄统一使用有效内断面。左右边界范围由有效宽度、另一侧偏移和最小车道总宽共同推导,manifest 与 solver 共用端点且越界阻塞。兼容数值输入及既有 `offsetDegrees` 文档。
|
||||
|
||||
浏览器回归现逐项编辑接入位置、方向和左右边界,验证请求被应用且目标道路面实际变化,并逐项撤销;随后继续验证过渡长度保存、正式重编译和刷新重放。该证据覆盖当前真实工作台 fixture,第二类结构的浏览器闭环仍需在最终 A4 矩阵中补齐。
|
||||
|
||||
本轮同时修复成功闭合且接缝合格的核心仍被误报为 `complex-junction-core-closure-unsupported` 的条件分支。npm test、191 项客户端单测、类型检查、生产构建、11 项 E2E、format:check 与 git diff --check 通过。区域邻接和排除区共同决定的更大向外边界仍留给区域级求解,不用固定范围冒充完整可行域。
|
||||
|
||||
本轮质量门:npm test 通过;npm run test:client 通过;npm run test:client:unit 15 文件/188 测试通过;npm run test:e2e(包含 production build)11 测试通过,包含保存后重置与放弃恢复;npm run format:check 与 git diff --check 通过。构建仍有既有 bundle 大小提示。遵循用户“整体任务完成再提交”,本轮未提交、未归档父任务。
|
||||
|
||||
@@ -274,6 +274,12 @@ test.describe('workbench editing shell', () => {
|
||||
const baselinePreview = await page.request
|
||||
.post('/api/edit-preview', { data: { previewSeq: 0, document: scoped.document, selection: { cluster: id } } })
|
||||
.then((response) => response.json());
|
||||
const roadGeometry = (
|
||||
preview: {
|
||||
layers: { roadSurface: { features: Array<{ properties: { native_id?: string }; geometry: unknown }> } };
|
||||
},
|
||||
nativeId: string,
|
||||
) => preview.layers.roadSurface.features.find((feature) => feature.properties.native_id === nativeId)?.geometry;
|
||||
const previewRequest = page.waitForRequest(
|
||||
(request) => request.method() === 'POST' && request.url().endsWith('/api/edit-preview'),
|
||||
);
|
||||
@@ -299,6 +305,39 @@ test.describe('workbench editing shell', () => {
|
||||
}) => preview.layers.roadSurface.features.find((feature) => feature.properties.corner_key === cornerKey)?.geometry;
|
||||
expect(cornerGeometry(updatedPreview)).not.toEqual(cornerGeometry(baselinePreview));
|
||||
await expect(parameterInput).toHaveValue(String(parameterValue + 2));
|
||||
|
||||
for (const edit of [
|
||||
{ kind: 'cluster-carriageway-position', label: '车行道接入位置', delta: 1 },
|
||||
{ kind: 'cluster-carriageway-direction', label: '车行道接入方向', delta: 1 },
|
||||
{ kind: 'cluster-carriageway-edge-offset', label: '车行道左右边界', delta: 0.25 },
|
||||
]) {
|
||||
const handle = scoped.handles.handles.find(
|
||||
(candidate: { kind: string; value: { current: number; max: number }; affects: string[] }) =>
|
||||
candidate.kind === edit.kind && candidate.value.current + edit.delta <= candidate.value.max,
|
||||
);
|
||||
expect(handle).toBeTruthy();
|
||||
const group = workspace.locator('.parameter-group').filter({ hasText: edit.label }).first();
|
||||
await expect(group).toBeVisible();
|
||||
const expand = group.getByRole('button', { name: '展开单独定制' });
|
||||
if (await expand.count()) await expand.click();
|
||||
const input = group.locator(`[data-handle-id="${handle.handleId}"] .parameter-input`);
|
||||
const nextValue = Math.round((handle.value.current + edit.delta) * 100) / 100;
|
||||
const editResponse = page.waitForResponse(
|
||||
(candidate) =>
|
||||
candidate.request().method() === 'POST' &&
|
||||
candidate.url().endsWith('/api/edit-preview') &&
|
||||
candidate
|
||||
.request()
|
||||
.postDataJSON()
|
||||
?.constraints?.some((constraint: { kind: string }) => constraint.kind === edit.kind),
|
||||
);
|
||||
await input.fill(String(nextValue));
|
||||
await input.press('Enter');
|
||||
const editResult = await (await editResponse).json();
|
||||
expect(editResult.constraintStates.every((state: { applied: boolean }) => state.applied)).toBe(true);
|
||||
expect(roadGeometry(editResult, handle.affects[0])).not.toEqual(roadGeometry(baselinePreview, handle.affects[0]));
|
||||
await page.getByRole('button', { name: '撤销', exact: true }).click();
|
||||
}
|
||||
await page.reload();
|
||||
await expect(armButtons).toHaveCount(structure.arms.length);
|
||||
await expect(armButtons.first()).toHaveAttribute('aria-pressed', 'false');
|
||||
|
||||
Reference in new issue
Block a user