Files
Genarrative/src/services/storyEngine/branchBudgetPlanner.test.ts
kdletters cbc27bad4a
Some checks failed
CI / verify (push) Has been cancelled
init with react+axum+spacetimedb
2026-04-26 18:06:23 +08:00

31 lines
1.1 KiB
TypeScript

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);
});
});