fix: align business pages and detail drawers with prototype

This commit is contained in:
Yvan
2026-11-05 16:18:39 +08:00
parent 27cacffc7f
commit db11b6eb54
28 changed files with 603 additions and 87 deletions
+9 -4
View File
@@ -110,7 +110,12 @@ func TestChannelLevelTwoScopeAndUnavailableMetrics(t *testing.T) {
func TestChannelCreateOwnsHashAndSettlementDefaults(t *testing.T) {
uc, r, _, writer, encoder := channelFixture()
input := &ChannelCreate{SourceDB: " LX ", Account: " 中文渠道 ", Password: " pass123 ", BusierID: 14, RegisterType: 1}
result, err := uc.Create(accountContext(8, 902), input)
for _, actor := range [][2]uint{{7, 901}, {8, 902}} {
if _, err := uc.Create(accountContext(actor[0], actor[1]), input); err != ErrChannelCreateScope {
t.Fatal("一级和二级商务不能添加渠道")
}
}
result, err := uc.Create(accountContext(9, 903), input)
if err != nil || result.ID != 123 || result.SourceDB != "lx" {
t.Fatalf("创建失败: %+v %v", result, err)
}
@@ -118,17 +123,17 @@ func TestChannelCreateOwnsHashAndSettlementDefaults(t *testing.T) {
t.Fatalf("创建参数或结算周期错误: %+v", writer.input)
}
input.BusierID = 999
if _, err := uc.Create(accountContext(8, 902), input); err != ErrChannelBinding {
if _, err := uc.Create(accountContext(9, 903), input); err != ErrChannelBinding {
t.Fatal("选择了范围外的绑定")
}
input.BusierID = 14
input.Account = "bad_underscore"
if _, err := uc.Create(accountContext(8, 902), input); err != ErrChannelAccount {
if _, err := uc.Create(accountContext(9, 903), input); err != ErrChannelAccount {
t.Fatal("渠道账号字符限制丢失")
}
input.Account = "valid123"
input.Password = "12345"
if _, err := uc.Create(accountContext(8, 902), input); err != ErrChannelPassword {
if _, err := uc.Create(accountContext(9, 903), input); err != ErrChannelPassword {
t.Fatal("密码长度未校验")
}
}