支持在线时间跨天并优化发布与筛选体验
允许在线时段 end 早于 start 表示跨天,统一展示「次日」文案;修复移动端价格区间清空后被 sessionStorage 回写;优化 PC/移动端在线时间控件密度与通栏展示。
This commit is contained in:
@@ -93,7 +93,7 @@ func TestValidateRequiredOnlineTimeRejectsMissing(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestValidateRequiredOnlineTimeRejectsInvalidRange(t *testing.T) {
|
||||
func TestValidateRequiredOnlineTimeAllowsCrossDay(t *testing.T) {
|
||||
req := CreateRequest{
|
||||
AssetSummary: map[string]any{
|
||||
"online_time": map[string]any{
|
||||
@@ -103,6 +103,21 @@ func TestValidateRequiredOnlineTimeRejectsInvalidRange(t *testing.T) {
|
||||
},
|
||||
}
|
||||
|
||||
if err := validateRequiredOnlineTime(req); err != nil {
|
||||
t.Fatalf("expected cross-day range to be valid, got %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestValidateRequiredOnlineTimeRejectsSameStartEnd(t *testing.T) {
|
||||
req := CreateRequest{
|
||||
AssetSummary: map[string]any{
|
||||
"online_time": map[string]any{
|
||||
"start": "10:00",
|
||||
"end": "10:00",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
if err := validateRequiredOnlineTime(req); err != ErrInvalidOnlineTime {
|
||||
t.Fatalf("expected ErrInvalidOnlineTime, got %v", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user