Files
portal/tools/verdict-outcome-classify.test.mjs
T

10 lines
806 B
JavaScript

import { describe, it, expect } from 'vitest';
import { classifyJudgeOutcome } from './enforce-judge-gate.mjs';
describe('classifyJudgeOutcome', () => {
it('GO', () => expect(classifyJudgeOutcome({ block: false }, { wired: true, decision: 'GO' })).toEqual({ kind: 'go' }));
it('degraded no_key', () => expect(classifyJudgeOutcome({ block: true, degraded: true }, { unavailable: true, cause: 'no_key' })).toEqual({ kind: 'degraded', reason: 'нет ключа судьи' }));
it('skip', () => expect(classifyJudgeOutcome({ block: false }, { skip: 'no_mentor_go' })).toEqual({ kind: 'skip', reason: 'no_mentor_go' }));
it('nogo + текст', () => expect(classifyJudgeOutcome({ block: true, message: '🚫 X' }, { wired: true, decision: 'NO-GO' })).toEqual({ kind: 'nogo', text: '🚫 X' }));
});