feat(agents): человекочитаемые вердикты аналитика, ревьюера, dev и постмортема в панель «Логи»
This commit is contained in:
@@ -1090,3 +1090,46 @@ func TestRenderPostMortemPrompt(t *testing.T) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// TestFormatReviewVerdict — человекочитаемое описание вердикта ревьюера.
|
||||
func TestFormatReviewVerdict(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
v *reviewVerdict
|
||||
want []string
|
||||
}{
|
||||
{
|
||||
name: "passed with everything",
|
||||
v: &reviewVerdict{
|
||||
Passed: true,
|
||||
CriticalIssues: []string{"bug A"},
|
||||
SolidViolations: []string{"v1", "v2"},
|
||||
Comments: []string{"comment"},
|
||||
},
|
||||
want: []string{"passed=yes", "critical=[bug A]", "solid=[v1 | v2]", "comments=[comment]"},
|
||||
},
|
||||
{
|
||||
name: "failed with critical only",
|
||||
v: &reviewVerdict{
|
||||
Passed: false,
|
||||
CriticalIssues: []string{"bug A", "bug B"},
|
||||
},
|
||||
want: []string{"passed=no", "critical=[bug A | bug B]"},
|
||||
},
|
||||
{
|
||||
name: "empty verdict",
|
||||
v: &reviewVerdict{},
|
||||
want: []string{"passed=no"},
|
||||
},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
got := formatReviewVerdict(tt.v)
|
||||
for _, w := range tt.want {
|
||||
if !strings.Contains(got, w) {
|
||||
t.Errorf("formatReviewVerdict = %q, want contain %q", got, w)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user