Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions test/commands/artifact-workflow.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,28 +184,28 @@ describe('artifact-workflow CLI commands', () => {
});
expect(result.exitCode).toBe(1);
const output = getOutput(result);
expect(output).toContain("Schema 'unknown' not found");
expect(output).toContain("未找到架构 'unknown'");
});

it('rejects path traversal in change name', async () => {
const result = await runCLI(['status', '--change', '../foo'], { cwd: tempDir });
expect(result.exitCode).toBe(1);
const output = getOutput(result);
expect(output).toContain('Invalid change name');
expect(output).toContain('变更名称无效');
});

it('rejects absolute path in change name', async () => {
const result = await runCLI(['status', '--change', '/etc/passwd'], { cwd: tempDir });
expect(result.exitCode).toBe(1);
const output = getOutput(result);
expect(output).toContain('Invalid change name');
expect(output).toContain('变更名称无效');
});

it('rejects slashes in change name', async () => {
const result = await runCLI(['status', '--change', 'foo/bar'], { cwd: tempDir });
expect(result.exitCode).toBe(1);
const output = getOutput(result);
expect(output).toContain('Invalid change name');
expect(output).toContain('变更名称无效');
});
});

Expand Down Expand Up @@ -269,8 +269,8 @@ describe('artifact-workflow CLI commands', () => {
const result = await runCLI(['instructions', '--change', 'test-change'], { cwd: tempDir });
expect(result.exitCode).toBe(1);
const output = getOutput(result);
expect(output).toContain('Missing required argument <artifact>');
expect(output).toContain('Valid artifacts:');
expect(output).toContain('缺少必需参数 <artifact>');
expect(output).toContain('有效的产出物:');
});

it('errors for unknown artifact', async () => {
Expand Down Expand Up @@ -319,7 +319,7 @@ describe('artifact-workflow CLI commands', () => {
const result = await runCLI(['templates', '--schema', 'nonexistent'], { cwd: tempDir });
expect(result.exitCode).toBe(1);
const output = getOutput(result);
expect(output).toContain("Schema 'nonexistent' not found");
expect(output).toContain("未找到架构 'nonexistent'");
});
});

Expand Down Expand Up @@ -352,7 +352,7 @@ describe('artifact-workflow CLI commands', () => {
const result = await runCLI(['new', 'change', 'invalid name'], { cwd: tempDir });
expect(result.exitCode).toBe(1);
const output = getOutput(result);
expect(output).toContain('Error');
expect(output).toContain('错误');
});

it('errors for duplicate change name', async () => {
Expand All @@ -378,10 +378,10 @@ describe('artifact-workflow CLI commands', () => {
cwd: tempDir,
});
expect(result.exitCode).toBe(0);
expect(result.stdout).toContain('## Apply: apply-change');
expect(result.stdout).toContain('Schema: spec-driven');
expect(result.stdout).toContain('### Context Files');
expect(result.stdout).toContain('### Instruction');
expect(result.stdout).toContain('## 应用: apply-change');
expect(result.stdout).toContain('架构: spec-driven');
expect(result.stdout).toContain('上下文文件:');
expect(result.stdout).toContain('指令:');
});

it('shows blocked state when required artifacts are missing', async () => {
Expand All @@ -392,7 +392,7 @@ describe('artifact-workflow CLI commands', () => {
cwd: tempDir,
});
expect(result.exitCode).toBe(0);
expect(result.stdout).toContain('Blocked');
expect(result.stdout).toContain('被阻塞');
expect(result.stdout).toContain('缺失的产出物: tasks');
});

Expand Down Expand Up @@ -454,7 +454,7 @@ describe('artifact-workflow CLI commands', () => {
{ cwd: tempDir }
);
expect(result.exitCode).toBe(0);
expect(result.stdout).toContain('Schema: spec-driven');
expect(result.stdout).toContain('架构: spec-driven');
});

it('spec-driven schema uses apply block configuration', async () => {
Expand Down Expand Up @@ -562,7 +562,7 @@ artifacts:
// All artifacts exist, should be ready with default instruction
expect(json.schemaName).toBe('no-apply-full');
expect(json.state).toBe('ready');
expect(json.instruction).toContain('All required artifacts complete');
expect(json.instruction).toContain('所有必需的产出物已完成');
});
});

Expand Down
4 changes: 2 additions & 2 deletions test/commands/config-profile.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ describe('diffProfileState workflow formatting', () => {
);

expect(diff.hasChanges).toBe(true);
expect(diff.lines).toEqual(['workflows: removed sync']);
expect(diff.lines).toEqual(['工作流:已移除 sync']);
});

it('uses explicit labels when workflows are added and removed', async () => {
Expand All @@ -52,7 +52,7 @@ describe('diffProfileState workflow formatting', () => {
);

expect(diff.hasChanges).toBe(true);
expect(diff.lines).toEqual(['workflows: added verify; removed sync']);
expect(diff.lines).toEqual(['工作流:已添加 verify;已移除 sync']);
});
});

Expand Down
2 changes: 1 addition & 1 deletion test/core/artifact-graph/instruction-loader.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ describe('instruction-loader', () => {
const context = loadChangeContext(tempDir, 'my-change');

expect(() => generateInstructions(context, 'nonexistent')).toThrow(
"Artifact 'nonexistent' not found"
"未找到产出物 'nonexistent'"
);
});

Expand Down
4 changes: 2 additions & 2 deletions test/core/init.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ describe('InitCommand', () => {
it('should throw error in non-interactive mode without --tools flag and no detected tools', async () => {
const initCommand = new InitCommand({ interactive: false });

await expect(initCommand.execute(testDir)).rejects.toThrow(/No tools detected and no --tools flag/);
await expect(initCommand.execute(testDir)).rejects.toThrow(/未检测到工具且未提供 --tools 参数/);
});
});

Expand Down Expand Up @@ -520,7 +520,7 @@ describe('InitCommand - profile and detection features', () => {
});

await expect(initCommand.execute(testDir)).rejects.toThrow(
/Invalid profile "invalid-profile"/
/无效的档案 "invalid-profile"/
);
});

Expand Down