详情页面kd 展示,发布时间必填
This commit is contained in:
@@ -58,6 +58,44 @@ func TestValidateRequestRequiresDepositAboveConsumables(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestValidateRequiredOnlineTime(t *testing.T) {
|
||||
req := CreateRequest{
|
||||
AssetSummary: map[string]any{
|
||||
"online_time": map[string]any{
|
||||
"start": "09:00",
|
||||
"end": "23:00",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
if err := validateRequiredOnlineTime(req); err != nil {
|
||||
t.Fatalf("expected valid online time, got %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestValidateRequiredOnlineTimeRejectsMissing(t *testing.T) {
|
||||
req := CreateRequest{AssetSummary: map[string]any{}}
|
||||
|
||||
if err := validateRequiredOnlineTime(req); err != ErrMissingOnlineTime {
|
||||
t.Fatalf("expected ErrMissingOnlineTime, got %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestValidateRequiredOnlineTimeRejectsInvalidRange(t *testing.T) {
|
||||
req := CreateRequest{
|
||||
AssetSummary: map[string]any{
|
||||
"online_time": map[string]any{
|
||||
"start": "23:00",
|
||||
"end": "09:00",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
if err := validateRequiredOnlineTime(req); err != ErrInvalidOnlineTime {
|
||||
t.Fatalf("expected ErrInvalidOnlineTime, got %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestCreateRequiresPublishAgreements(t *testing.T) {
|
||||
service := NewService(&Repository{}, nil)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user