This commit is contained in:
34
src/services/storyEngine/endingResolver.test.ts
Normal file
34
src/services/storyEngine/endingResolver.test.ts
Normal file
@@ -0,0 +1,34 @@
|
||||
import { describe, expect, it } from 'vitest';
|
||||
|
||||
import { resolveEndingState } from './endingResolver';
|
||||
|
||||
describe('endingResolver', () => {
|
||||
it('builds ending states from threads, companions, and factions', () => {
|
||||
const ending = resolveEndingState({
|
||||
state: {
|
||||
storyEngineMemory: {
|
||||
activeThreadIds: ['thread-1', 'thread-2', 'thread-3'],
|
||||
},
|
||||
} as never,
|
||||
companionResolutions: [
|
||||
{
|
||||
characterId: 'archer-hero',
|
||||
resolutionType: 'bonded',
|
||||
summary: '她最终选择与你并肩到底。',
|
||||
relatedThreadIds: ['thread-1'],
|
||||
},
|
||||
],
|
||||
factionTensionStates: [
|
||||
{
|
||||
factionId: 'faction:巡边司:1',
|
||||
temperature: 72,
|
||||
pressureSummary: '巡边司一线已经被旧案推到了临界点。',
|
||||
activeConflictThreadIds: ['thread-1'],
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
expect(ending.endingType).toBe('bitter_sweet');
|
||||
expect(ending.title).toBeTruthy();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user