From eea54e1e9fd67ada51ad9a63b7ee4dde7c4329cd Mon Sep 17 00:00:00 2001 From: smail Date: Wed, 30 Sep 2026 05:14:16 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E5=89=8D=E7=AB=AF=E5=85=A8?= =?UTF-8?q?=E9=87=8F=E5=9B=9E=E5=BD=92=E5=A4=B9=E5=85=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 支持多行模块导入的安全设置测试夹具,并同步客户端协议 HTML 分行文案断言。 --- test/frontend/password-change.test.mjs | 2 +- test/frontend/protocol-client.test.mjs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/frontend/password-change.test.mjs b/test/frontend/password-change.test.mjs index e74f11b..3d0cd9a 100644 --- a/test/frontend/password-change.test.mjs +++ b/test/frontend/password-change.test.mjs @@ -6,7 +6,7 @@ import { computed, reactive, ref } from './vue.mjs' const source = readFileSync(new URL('../../frontend/src/views/components/SecuritySettings/SecuritySettings.js', import.meta.url), 'utf8') const createPage = compileFunction( - source.replace(/^import .*$/gm, '').replace('export function usePage', 'function usePage') + '\nreturn usePage()', + source.replace(/^import[\s\S]*?from .*$/gm, '').replace('export function usePage', 'function usePage') + '\nreturn usePage()', ['computed', 'reactive', 'ref', 'watch', 'onMounted', 'onUnmounted', 'http', 'useGlobalStatusStore', 'webAuthnSupported', 'lang', 'ElNotification', 'TextEncoder', 'location', 'setInterval', 'clearInterval'] ) diff --git a/test/frontend/protocol-client.test.mjs b/test/frontend/protocol-client.test.mjs index c14d8a5..1421c6b 100644 --- a/test/frontend/protocol-client.test.mjs +++ b/test/frontend/protocol-client.test.mjs @@ -18,8 +18,8 @@ test('邮件客户端文案明确区分专属授权码与完整邮箱登录', () const template = read('vue') assert.match(template, /客户端专属授权码/) assert.match(template, /请使用完整邮箱地址登录,密码统一使用上方专属授权码/) - assert.match(template, /IMAP 收信服务/) - assert.match(template, /POP3 收信服务/) - assert.match(template, /SMTP 发信服务/) + assert.match(template, /IMAP[\s\S]*?\u6536\u4fe1\u670d\u52a1/) + assert.match(template, /POP3[\s\S]*?\u6536\u4fe1\u670d\u52a1/) + assert.match(template, /SMTP[\s\S]*?\u53d1\u4fe1\u670d\u52a1/) assert.doesNotMatch(template, /第三方邮件|&#x[0-9a-f]+;/i) })