From b62b16cca70fdb98d3920a7b08cfb0fb4b039d63 Mon Sep 17 00:00:00 2001 From: ouyangxq <775153912@qq.com> Date: Fri, 14 Aug 2026 18:50:14 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/auth/views/AuthViews.test.mjs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/modules/auth/views/AuthViews.test.mjs b/src/modules/auth/views/AuthViews.test.mjs index 31f9a98..88bcd41 100644 --- a/src/modules/auth/views/AuthViews.test.mjs +++ b/src/modules/auth/views/AuthViews.test.mjs @@ -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\)\)/)