This commit is contained in:
2026-08-14 18:50:14 +08:00
parent 935e15a2d6
commit b62b16cca7
@@ -104,6 +104,12 @@ test('treats only body code 200 as success', () => {
assert.doesNotMatch(httpSource, /if \(envelope\.code !== '0'\)/)
})
test('shows the backend credential error on login', () => {
assert.match(httpSource, /new ApiError\(apiErrorMessage\(envelope\.message, fieldErrors\), envelope\.code/)
assert.match(loginSource, /ElMessage\.error\(error instanceof Error \? error\.message : '登录失败,请检查账号后重试'\)/)
assert.doesNotMatch(loginSource, /登录状态已失效,请重新登录/)
})
test('keeps a valid local session during temporary context and refresh outages', () => {
assert.match(authStoreSource, /function isExpiredSessionError/)
assert.match(authStoreSource, /if \(isExpiredSessionError\(error\)\)/)