Rework story engine flow and reorganize project docs
Some checks failed
CI / verify (push) Has been cancelled
Some checks failed
CI / verify (push) Has been cancelled
This commit is contained in:
24
src/services/storyEngine/campaignPackCompiler.test.ts
Normal file
24
src/services/storyEngine/campaignPackCompiler.test.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import { describe, expect, it } from 'vitest';
|
||||
|
||||
import { type CustomWorldProfile } from '../../types';
|
||||
import { compileCampaignFromWorldProfile } from './campaignPackCompiler';
|
||||
|
||||
describe('campaignPackCompiler', () => {
|
||||
it('builds scenario and campaign packs from a world profile', () => {
|
||||
const profile = {
|
||||
id: 'world-1',
|
||||
name: '裂潮边城',
|
||||
scenarioPackId: 'scenario-pack:rift',
|
||||
campaignPackId: 'campaign-pack:rift-main',
|
||||
storyGraph: {
|
||||
visibleThreads: [{ id: 'thread-1', title: '封桥旧案' }],
|
||||
},
|
||||
playableNpcs: [{ id: 'npc-1', templateCharacterId: 'archer-hero' }],
|
||||
} as unknown as CustomWorldProfile;
|
||||
|
||||
const compiled = compileCampaignFromWorldProfile({ profile });
|
||||
|
||||
expect(compiled.scenarioPack.id).toBe('scenario-pack:rift');
|
||||
expect(compiled.campaignPack.id).toBe('campaign-pack:rift-main');
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user