bb7633b318
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
21 lines
924 B
JavaScript
21 lines
924 B
JavaScript
import { describe, it, expect } from 'vitest';
|
|
import { applyExtraction, renderProtocol, EMPTY_PROTOCOL } from './secretary-protocol.mjs';
|
|
|
|
describe('secretary-protocol', () => {
|
|
it('добавляет решение с провенансом', () => {
|
|
const p = applyExtraction(EMPTY_PROTOCOL(), {
|
|
decisions: [{ text: 'единица = дело', why: 'тянется через сессии', turns: [7] }],
|
|
});
|
|
const md = renderProtocol(p);
|
|
expect(md).toContain('единица = дело');
|
|
expect(md).toContain('[→7]');
|
|
});
|
|
it('сверка зачёркивает, не удаляет', () => {
|
|
let p = applyExtraction(EMPTY_PROTOCOL(), { decisions: [{ text: 'A', turns: [1] }] });
|
|
p = applyExtraction(p, { supersede: [{ oldText: 'A', newText: 'B', turns: [2] }] });
|
|
const md = renderProtocol(p);
|
|
expect(md).toContain('~~A~~');
|
|
expect(md).toContain('B');
|
|
});
|
|
});
|