This commit is contained in:
2026-08-13 12:22:39 +08:00
parent f12cdcaa71
commit 5fc327a14d
3 changed files with 16 additions and 1 deletions
@@ -92,6 +92,13 @@ test('uses real auth endpoints and single-flight refresh handling', () => {
assert.doesNotMatch(authStoreSource, /mock-client:/)
})
test('handles impersonation exchange as public authentication and exposes failures', () => {
assert.match(httpSource, /publicAuthPaths = \[[^\]]*'\/auth\/impersonations\/exchange'/)
assert.match(authStoreSource, /\/login\?impersonation=failed/)
assert.match(loginSource, /route\.query\.impersonation === 'failed'/)
assert.match(loginSource, /代登录失败或授权已失效,请返回管理后台重新发起/)
})
test('treats only body code 200 as success', () => {
assert.match(httpSource, /if \(envelope\.code !== '200'\)/)
assert.doesNotMatch(httpSource, /if \(envelope\.code !== '0'\)/)