Align validator identity and span domain checks
This commit is contained in:
@@ -46,13 +46,17 @@ func TestValidateProtectedTermsAppliesToNonGlossaryModule(t *testing.T) {
|
||||
},
|
||||
ProposalMetadata: proposals.ProposalMetadata{ProposalIndex: 0},
|
||||
},
|
||||
{
|
||||
CorrectionProposal: proposals.CorrectionProposal{TargetSegmentID: 1, OriginalText: "Jesters", CorrectedText: "", Confidence: 0.9},
|
||||
ProposalMetadata: proposals.ProposalMetadata{ProposalIndex: 1},
|
||||
},
|
||||
},
|
||||
}
|
||||
res, err := ValidateProtectedTerms(req, false)
|
||||
if err != nil {
|
||||
t.Fatalf("validator error: %v", err)
|
||||
}
|
||||
if len(res.Decisions) != 1 || res.Decisions[0].Approved {
|
||||
if len(res.Decisions) != 2 || res.Decisions[0].Approved || res.Decisions[1].Approved || res.Decisions[1].ReasonCode != ReasonProtectedGlossaryTerm {
|
||||
t.Fatalf("expected protected-term rejection, got %+v", res.Decisions)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user