30 lines
750 B
TypeScript
30 lines
750 B
TypeScript
import { describe, expect, it } from 'vitest';
|
|
|
|
import { advanceCampaignState, resolveCampaignState } from './campaignDirector';
|
|
|
|
describe('campaignDirector', () => {
|
|
it('resolves and advances campaign state', () => {
|
|
const campaign = resolveCampaignState({
|
|
state: {
|
|
customWorldProfile: { name: '裂潮边城' },
|
|
} as never,
|
|
actState: {
|
|
id: 'act-2',
|
|
title: '第二幕·扩张',
|
|
actIndex: 1,
|
|
theme: '冲突升级',
|
|
primaryThreadIds: ['thread-1'],
|
|
status: 'midgame',
|
|
},
|
|
});
|
|
|
|
expect(campaign.currentActIndex).toBe(1);
|
|
expect(
|
|
advanceCampaignState({
|
|
previous: campaign,
|
|
next: campaign,
|
|
}).id,
|
|
).toBe(campaign.id);
|
|
});
|
|
});
|