fix: accept rectifying low-confidence terminal results
This commit is contained in:
@@ -19,6 +19,22 @@ const terminalCase = {
|
||||
},
|
||||
};
|
||||
|
||||
const lowTerminalCase = {
|
||||
...terminalCase,
|
||||
status: "rectifying",
|
||||
candidate_result: {
|
||||
...terminalCase.candidate_result,
|
||||
confidence: "low",
|
||||
},
|
||||
turn_state: {
|
||||
...terminalCase.turn_state,
|
||||
nextAction: {
|
||||
kind: "present_low_result",
|
||||
resultId: terminalCase.candidate_result_id,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
test("candidate completion only accepts the persisted terminal representative time", () => {
|
||||
assert.equal(candidateWorkingTime(terminalCase, {
|
||||
caseId: terminalCase.id,
|
||||
@@ -33,6 +49,31 @@ test("candidate completion only accepts the persisted terminal representative ti
|
||||
}), null);
|
||||
});
|
||||
|
||||
test("accepts a matching low-confidence result from the rectifying state", () => {
|
||||
assert.equal(candidateWorkingTime(lowTerminalCase, {
|
||||
caseId: terminalCase.id,
|
||||
resultId: terminalCase.candidate_result_id,
|
||||
time: "04:53",
|
||||
}), "04:53");
|
||||
});
|
||||
|
||||
test("does not accept a medium terminal action from the rectifying state", () => {
|
||||
assert.equal(candidateWorkingTime({
|
||||
...lowTerminalCase,
|
||||
turn_state: {
|
||||
...lowTerminalCase.turn_state,
|
||||
nextAction: {
|
||||
kind: "present_medium_result",
|
||||
resultId: terminalCase.candidate_result_id,
|
||||
},
|
||||
},
|
||||
}, {
|
||||
caseId: terminalCase.id,
|
||||
resultId: terminalCase.candidate_result_id,
|
||||
time: "04:53",
|
||||
}), null);
|
||||
});
|
||||
|
||||
test("non-terminal cases cannot be adopted for consultation", () => {
|
||||
assert.equal(candidateWorkingTime({
|
||||
...terminalCase,
|
||||
|
||||
Reference in New Issue
Block a user