Files
brain/tools/verdict-wait.test.mjs
T

16 lines
931 B
JavaScript

import { describe, it, expect } from 'vitest';
import { isStageSettled, formatWaitResult } from './verdict-wait.mjs';
describe('verdict-wait сторож (read-only, по-этапно)', () => {
it('isStageSettled: pending → false, исход → true, нет записи → false', () => {
expect(isStageSettled({ 'mentor:plan': { status: 'pending' } }, 'mentor:plan')).toBe(false);
expect(isStageSettled({ 'mentor:plan': { status: 'GO' } }, 'mentor:plan')).toBe(true);
expect(isStageSettled({}, 'mentor:plan')).toBe(false);
});
it('formatWaitResult: pending / исход / нет записи', () => {
expect(formatWaitResult({ router: { status: 'pending' } }, 'router')).toMatch(/печётся/);
expect(formatWaitResult({ router: { status: 'recommend', reason: 'skill-x' } }, 'router')).toMatch(/recommend/);
expect(formatWaitResult({}, 'router')).toMatch(/нет записи/);
});
});