25 lines
882 B
TypeScript
25 lines
882 B
TypeScript
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');
|
|
});
|
|
});
|