80 lines
2.6 KiB
TypeScript
80 lines
2.6 KiB
TypeScript
import { describe, expect, test } from 'vitest';
|
|
|
|
import {
|
|
getUnifiedCreationSpec,
|
|
listUnifiedCreationSpecs,
|
|
} from './unifiedCreationSpecs';
|
|
|
|
describe('unified creation specs', () => {
|
|
test('统一壳覆盖所有已有创作模板工作台', () => {
|
|
expect(listUnifiedCreationSpecs().map((spec) => spec.playId).sort()).toEqual(
|
|
[
|
|
'baby-object-match',
|
|
'bark-battle',
|
|
'big-fish',
|
|
'creative-agent',
|
|
'jump-hop',
|
|
'match3d',
|
|
'puzzle',
|
|
'rpg',
|
|
'square-hole',
|
|
'visual-novel',
|
|
'wooden-fish',
|
|
],
|
|
);
|
|
});
|
|
|
|
test('字段模型只包含首期公共能力', () => {
|
|
const fieldKinds = new Set(
|
|
listUnifiedCreationSpecs().flatMap((spec) =>
|
|
spec.fields.map((field) => field.kind),
|
|
),
|
|
);
|
|
|
|
expect([...fieldKinds].sort()).toEqual(['audio', 'image', 'select', 'text']);
|
|
});
|
|
|
|
test('主要链路都映射到统一创作、生成、结果阶段', () => {
|
|
expect(getUnifiedCreationSpec('rpg')).toMatchObject({
|
|
workspaceStage: 'agent-workspace',
|
|
generationStage: 'custom-world-generating',
|
|
resultStage: 'custom-world-result',
|
|
});
|
|
expect(getUnifiedCreationSpec('puzzle')).toMatchObject({
|
|
workspaceStage: 'puzzle-agent-workspace',
|
|
generationStage: 'puzzle-generating',
|
|
resultStage: 'puzzle-result',
|
|
});
|
|
expect(getUnifiedCreationSpec('match3d')).toMatchObject({
|
|
workspaceStage: 'match3d-agent-workspace',
|
|
generationStage: 'match3d-generating',
|
|
resultStage: 'match3d-result',
|
|
});
|
|
expect(getUnifiedCreationSpec('jump-hop')).toMatchObject({
|
|
workspaceStage: 'jump-hop-workspace',
|
|
generationStage: 'jump-hop-generating',
|
|
resultStage: 'jump-hop-result',
|
|
});
|
|
expect(getUnifiedCreationSpec('wooden-fish')).toMatchObject({
|
|
workspaceStage: 'wooden-fish-workspace',
|
|
generationStage: 'wooden-fish-generating',
|
|
resultStage: 'wooden-fish-result',
|
|
});
|
|
expect(getUnifiedCreationSpec('bark-battle')).toMatchObject({
|
|
workspaceStage: 'bark-battle-workspace',
|
|
generationStage: 'bark-battle-generating',
|
|
resultStage: 'bark-battle-result',
|
|
});
|
|
expect(getUnifiedCreationSpec('visual-novel')).toMatchObject({
|
|
workspaceStage: 'visual-novel-agent-workspace',
|
|
generationStage: 'visual-novel-generating',
|
|
resultStage: 'visual-novel-result',
|
|
});
|
|
expect(getUnifiedCreationSpec('baby-object-match')).toMatchObject({
|
|
workspaceStage: 'baby-object-match-workspace',
|
|
generationStage: 'baby-object-match-generating',
|
|
resultStage: 'baby-object-match-result',
|
|
});
|
|
});
|
|
});
|