31 lines
1.1 KiB
TypeScript
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);
|
|
});
|
|
});
|