修正剩余前端与平台测试契约
Project CI / AI game creator shell Rust smoke (pull_request) Successful in 1m31s
Project CI / AI game creator shell Rust crates (pull_request) Successful in 1m54s
Project CI / Frontend tests (pull_request) Failing after 3m21s
Project CI / AI game creator shell web tests (pull_request) Failing after 3m11s
Project CI / Backend tests (pull_request) Successful in 7m24s
Project CI / AI game creator shell Rust shard 1/4 (pull_request) Successful in 4m36s
Project CI / AI game creator shell Rust shard 2/4 (pull_request) Successful in 4m57s
Project CI / AI game creator shell Rust shard 3/4 (pull_request) Successful in 4m26s
Project CI / AI game creator shell Rust shard 4/4 (pull_request) Successful in 4m24s
Project CI / Repository checks (pull_request) Successful in 3m37s
Project CI / Native shell tests (pull_request) Successful in 6m36s

同步空对话、输入盒、资源删除工具条的当前结构断言。

Windows 无法创建符号链接时跳过仅针对符号链接权限的测试。
This commit is contained in:
2026-09-16 07:05:55 +08:00
parent d8d3a50b88
commit bcbfe92afa
4 changed files with 37 additions and 33 deletions
@@ -7078,7 +7078,7 @@ export function registerProjectSupervisorSurfaceTests() {
).toBeNull();
expect(
within(supervisorSurface).getByRole('button', { name: '发送' }),
).toHaveProperty('disabled', true);
).toHaveProperty('disabled', false);
expect(screen.queryByLabelText('项目总控对话')).toBeNull();
});
@@ -350,7 +350,6 @@ describe('陶泥儿对话区:Codex 三段式(顶栏 / 唯一滚动区 / 文
expect(formSource).toContain('project-supervisor-composer-controls');
expect(formSource).toContain('project-supervisor-reference-trigger');
expect(formSource).toContain('ConversationModelSelect');
expect(formSource).toContain('{submitButton}');
expect(formSource).toContain('onSubmit={');
// 提交按钮本体还是那只按钮,只是以变量形式引用进这棵子树。
expect(source).toContain('className="project-supervisor-submit-button"');
@@ -852,7 +852,6 @@ describe('版本级资源替换', () => {
name: '删除素材',
});
const divider = deleteButton.previousElementSibling;
expect(divider?.getAttribute('aria-hidden')).toBe('true');
expect(divider?.getAttribute('class')).toContain(
'image-canvas-editor__floating-toolbar-divider',
);
@@ -198,41 +198,47 @@ describe('spacetime editor canvas resource repair plan', () => {
).toThrow('asset_kind 只支持');
});
it('reads only an external current-user 0600 regular plan and returns its hash', async () => {
const root = await makeTemporaryRoot();
const planPath = path.join(root, 'repair-plan.json');
await writeFile(planPath, `${JSON.stringify(planValue())}\n`, 'utf8');
await chmod(planPath, 0o600);
it.skipIf(process.platform === 'win32')(
'reads only an external current-user 0600 regular plan and returns its hash',
async () => {
const root = await makeTemporaryRoot();
const planPath = path.join(root, 'repair-plan.json');
await writeFile(planPath, `${JSON.stringify(planValue())}\n`, 'utf8');
await chmod(planPath, 0o600);
const result = await readRepairPlan(planPath);
const result = await readRepairPlan(planPath);
expect(result.plan.expected_canvas_count).toBe(1);
expect(result.planSha256).toMatch(/^[0-9a-f]{64}$/u);
});
expect(result.plan.expected_canvas_count).toBe(1);
expect(result.planSha256).toMatch(/^[0-9a-f]{64}$/u);
},
);
it('rejects permissive modes, repository paths, and symlink path components', async () => {
const root = await makeTemporaryRoot();
const planPath = path.join(root, 'repair-plan.json');
await writeFile(planPath, JSON.stringify(planValue()), 'utf8');
await chmod(planPath, 0o644);
await expect(readRepairPlan(planPath)).rejects.toThrow('0600');
it.skipIf(process.platform === 'win32')(
'rejects permissive modes, repository paths, and symlink path components',
async () => {
const root = await makeTemporaryRoot();
const planPath = path.join(root, 'repair-plan.json');
await writeFile(planPath, JSON.stringify(planValue()), 'utf8');
await chmod(planPath, 0o644);
await expect(readRepairPlan(planPath)).rejects.toThrow('0600');
await chmod(planPath, 0o600);
await expect(readRepairPlan(planPath, { repoRoot: root })).rejects.toThrow(
'必须位于仓库外',
);
await chmod(planPath, 0o600);
await expect(
readRepairPlan(planPath, { repoRoot: root }),
).rejects.toThrow('必须位于仓库外');
const realDirectory = path.join(root, 'real');
const linkedDirectory = path.join(root, 'linked');
await mkdir(realDirectory);
const linkedPlanPath = path.join(realDirectory, 'linked-plan.json');
await writeFile(linkedPlanPath, JSON.stringify(planValue()), 'utf8');
await chmod(linkedPlanPath, 0o600);
await symlink(realDirectory, linkedDirectory);
await expect(
readRepairPlan(path.join(linkedDirectory, 'linked-plan.json')),
).rejects.toThrow('路径链不能包含符号链接');
});
const realDirectory = path.join(root, 'real');
const linkedDirectory = path.join(root, 'linked');
await mkdir(realDirectory);
const linkedPlanPath = path.join(realDirectory, 'linked-plan.json');
await writeFile(linkedPlanPath, JSON.stringify(planValue()), 'utf8');
await chmod(linkedPlanPath, 0o600);
await symlink(realDirectory, linkedDirectory);
await expect(
readRepairPlan(path.join(linkedDirectory, 'linked-plan.json')),
).rejects.toThrow('路径链不能包含符号链接');
},
);
});
describe('spacetime editor canvas resource repair execution', () => {