This commit is contained in:
30
src/services/storyEngine/branchBudgetPlanner.test.ts
Normal file
30
src/services/storyEngine/branchBudgetPlanner.test.ts
Normal file
@@ -0,0 +1,30 @@
|
||||
import { describe, expect, it } from 'vitest';
|
||||
|
||||
import { evaluateBranchBudget } from './branchBudgetPlanner';
|
||||
|
||||
describe('branchBudgetPlanner', () => {
|
||||
it('reports high pressure when divergences exceed authorial budget', () => {
|
||||
const status = evaluateBranchBudget({
|
||||
consequenceLedger: [
|
||||
{ id: '1', category: 'thread', title: 'A', summary: 'A', weight: 3, relatedIds: [], irreversible: true },
|
||||
{ id: '2', category: 'thread', title: 'B', summary: 'B', weight: 3, relatedIds: [], irreversible: true },
|
||||
{ id: '3', category: 'thread', title: 'C', summary: 'C', weight: 3, relatedIds: [], irreversible: true },
|
||||
{ id: '4', category: 'thread', title: 'D', summary: 'D', weight: 3, relatedIds: [], irreversible: true },
|
||||
],
|
||||
authorialConstraintPack: {
|
||||
toneRules: [],
|
||||
noGoPatterns: [],
|
||||
branchBudget: {
|
||||
maxMajorDivergences: 3,
|
||||
maxEndingFamilies: 5,
|
||||
},
|
||||
mandatoryThemes: [],
|
||||
requiredPayoffs: [],
|
||||
},
|
||||
endingFamilyCount: 1,
|
||||
});
|
||||
|
||||
expect(status.pressure).toBe('high');
|
||||
expect(status.issues.length).toBeGreaterThan(0);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user