规范气站客服工单枚举
This commit is contained in:
22
backend/api/internal/logic/gas/ticket_values_test.go
Normal file
22
backend/api/internal/logic/gas/ticket_values_test.go
Normal file
@@ -0,0 +1,22 @@
|
||||
package gas
|
||||
|
||||
import "testing"
|
||||
|
||||
// TestSupportedTicketValues 验证气站端工单枚举白名单。
|
||||
func TestSupportedTicketValues(t *testing.T) {
|
||||
for _, category := range []string{"delivery", "installation", "repair", "inspection", "reinspection", "customer_service"} {
|
||||
if !isSupportedTicketCategory(category) {
|
||||
t.Fatalf("标准工单分类未通过校验:%s", category)
|
||||
}
|
||||
}
|
||||
for _, priority := range []string{"low", "normal", "high", "urgent"} {
|
||||
if !isSupportedTicketPriority(priority) {
|
||||
t.Fatalf("标准工单优先级未通过校验:%s", priority)
|
||||
}
|
||||
}
|
||||
for _, value := range []string{"", "unknown", " normal "} {
|
||||
if isSupportedTicketCategory(value) || isSupportedTicketPriority(value) {
|
||||
t.Fatalf("非标准工单枚举不应通过校验:%q", value)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user