修复微信扫码区服识别
This commit is contained in:
@@ -566,6 +566,28 @@ func TestExternalAccountToCreateRequestMapsUploadFields(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestServerRegionFromLoginMethod(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
loginMethod string
|
||||
want string
|
||||
}{
|
||||
{name: "QQ账号密码", loginMethod: "QQ账号密码", want: "QQ"},
|
||||
{name: "微信扫码", loginMethod: "微信扫码", want: "微信"},
|
||||
{name: "VX扫码", loginMethod: "VX扫码", want: "微信"},
|
||||
{name: "小写WX扫码", loginMethod: "wx扫码", want: "微信"},
|
||||
{name: "Steam", loginMethod: "Steam令牌", want: "Steam"},
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
if got := serverRegionFromLoginMethod(tt.loginMethod); got != tt.want {
|
||||
t.Fatalf("serverRegionFromLoginMethod(%q) = %q, want %q", tt.loginMethod, got, tt.want)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestExternalAccountToCreateRequestSeparatesPureCoinAndExtraItems(t *testing.T) {
|
||||
req := externalAccountToCreateRequest("客服1", 1772526103000, ExternalAccountData{
|
||||
LoginMethod: "QQ账号密码",
|
||||
|
||||
Reference in New Issue
Block a user