feat(dingtalk): add reasoning mode and support evidence
This commit is contained in:
@@ -75,3 +75,29 @@ func TestSameFeedbackState(t *testing.T) {
|
||||
t.Fatal("value change must be a state change")
|
||||
}
|
||||
}
|
||||
|
||||
func TestFeedbackDownvoteEnsuresIdempotentSupportCaseInsideTransaction(t *testing.T) {
|
||||
data, err := os.ReadFile("feedback.go")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
source := strings.ToUpper(string(data))
|
||||
for _, required := range []string{
|
||||
"ENSUREFEEDBACKSUPPORTCASE",
|
||||
"SELECT ID FROM COVERAGE_DECISIONS",
|
||||
"TENANT_KEY=$1 AND CHANNEL=$2 AND TURN_ID=$3",
|
||||
"INSERT INTO SUPPORT_CASES",
|
||||
"TRIGGER_TYPE",
|
||||
"TRIGGER_FEEDBACK_ID",
|
||||
"'FEEDBACK_DOWN'",
|
||||
"ON CONFLICT (TENANT_KEY,CHANNEL,TURN_ID) DO NOTHING",
|
||||
"FAQEXPORTSTATUS(S.FAQEXPORTENABLED)",
|
||||
} {
|
||||
if !strings.Contains(source, required) {
|
||||
t.Errorf("feedback support wiring missing %q", required)
|
||||
}
|
||||
}
|
||||
if strings.Count(source, "ENSUREFEEDBACKSUPPORTCASE") < 4 {
|
||||
t.Fatal("create, replay, and changed-down paths must all ensure the same idempotent support case")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user