test(desktop): cover deepseek account name extraction for wechat + phone logins
Desktop Client Build / Resolve Build Metadata (push) Successful in 28s
Frontend CI / Frontend (push) Successful in 4m5s
Backend CI / Backend (push) Successful in 17m7s
Desktop Client Build / Publish Client Artifacts to NAS (push) Has been cancelled
Desktop Client Build / Build Desktop Client (push) Has been cancelled
Desktop Client Build / Resolve Build Metadata (push) Successful in 28s
Frontend CI / Frontend (push) Successful in 4m5s
Backend CI / Backend (push) Successful in 17m7s
Desktop Client Build / Publish Client Artifacts to NAS (push) Has been cancelled
Desktop Client Build / Build Desktop Client (push) Has been cancelled
Refactor readDeepseekAccountIdentity so the JSON payload parser is a pure
ts function (extractDeepseekIdentityFromPayload). The webContents IIFE now
just polls for userToken and returns the raw API JSON; payload picking lives
in ts and is unit-tested.
Tests lock the contract for both login types we observed in the wild:
- WeChat-bound account: id_profile.name = '阿白', picture present.
- Phone-only login: id_profile = null, mobile_number = '177******08',
email = '' (empty string, not null) — the case that originally regressed.
Plus regressions for the priority order (profile.name > mobile_number > email),
the all-empty fallback, and non-record payloads.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -132,6 +132,27 @@ func TestReconcileEnabledMonitoringPlatformsKeepsAuthorizedSubset(t *testing.T)
|
||||
assert.Empty(t, resolveMonitoringPlatforms(nil))
|
||||
}
|
||||
|
||||
func TestFilterMonitoringPlatformsByIDSetKeepsCatalogOrder(t *testing.T) {
|
||||
platforms := defaultMonitoringPlatformMetadata()
|
||||
|
||||
filtered := filterMonitoringPlatformsByIDSet(platforms, []string{"qwen", "yuanbao"})
|
||||
|
||||
assert.Equal(t, []string{"yuanbao", "qwen"}, monitoringPlatformIDs(filtered))
|
||||
}
|
||||
|
||||
func TestCollectNowDispatchTargetClientIDsDeduplicatesByPlatformOrder(t *testing.T) {
|
||||
sharedClientID := mustParseDailyMonitoringUUID(t, "00000000-0000-0000-0000-000000000501")
|
||||
qwenClientID := mustParseDailyMonitoringUUID(t, "00000000-0000-0000-0000-000000000502")
|
||||
|
||||
targets := collectNowDispatchTargetClientIDs(map[string]uuid.UUID{
|
||||
"yuanbao": sharedClientID,
|
||||
"qwen": qwenClientID,
|
||||
"doubao": sharedClientID,
|
||||
}, &sharedClientID)
|
||||
|
||||
assert.Equal(t, []uuid.UUID{sharedClientID, qwenClientID}, targets)
|
||||
}
|
||||
|
||||
func TestMonitoringPlatformAuthorizationStatus(t *testing.T) {
|
||||
clientID := uuid.New()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user