修正前端全量回归夹具
Some checks are pending
Security Checks / security (push) Waiting to run

支持多行模块导入的安全设置测试夹具,并同步客户端协议 HTML 分行文案断言。
This commit is contained in:
smail 2026-09-30 05:14:16 +08:00
parent 25d3796bae
commit eea54e1e9f
2 changed files with 4 additions and 4 deletions

View File

@ -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']
)

View File

@ -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)
})