fix(protocols): 修复邮件客户端授权码解密数据结构兼容与测试断言
This commit is contained in:
1 parent
c945169d49
commit
3e60c30931
3 files changed
+21
-11
No files matched your search
@@ -2,7 +2,7 @@ import assert from 'node:assert/strict'
|
||||
import test from 'node:test'
|
||||
import { readFileSync } from 'node:fs'
|
||||
import { compileFunction } from 'node:vm'
|
||||
import { ref } from './vue.mjs'
|
||||
import { reactive, ref } from './vue.mjs'
|
||||
|
||||
// 将已有真实 Vue 开关事件回归纳入默认前端测试,避免只覆盖调用函数的模拟。
|
||||
import '../review/protocol-frontend.test.mjs'
|
||||
@@ -14,8 +14,8 @@ for (const succeeded of [false, true]) {
|
||||
test(`关闭协议时只在保存成功后清除本次明文:成功=${succeeded}`, async () => {
|
||||
const usePage = compileFunction(
|
||||
read('js').replace(/^import .*$/gm, '').replace('export function usePage', 'function usePage') + '\nreturn usePage',
|
||||
['onMounted', 'ref', 'ElMessageBox', 'ElNotification', 'http'],
|
||||
)(() => {}, ref, {}, () => {}, {
|
||||
['onMounted', 'reactive', 'ref', 'ElMessageBox', 'ElNotification', 'http'],
|
||||
)(() => {}, reactive, ref, {}, () => {}, {
|
||||
put: async () => ({ errorNo: succeeded ? 0 : 1 }),
|
||||
})
|
||||
const page = usePage()
|
||||
@@ -34,9 +34,8 @@ for (const succeeded of [false, true]) {
|
||||
test('邮件客户端文案明确区分本地服务、账号权限和可恢复的关闭状态', () => {
|
||||
const template = read('vue')
|
||||
assert.match(template, /邮件客户端协议/)
|
||||
assert.match(template, /不依赖 SMTP 中继/)
|
||||
assert.match(template, /只控制当前账号/)
|
||||
assert.match(template, /重新开启可继续使用未撤销的授权码/)
|
||||
assert.match(template, /为 IMAP、POP3、SMTP 配置专属授权码/)
|
||||
assert.match(template, /当前账号客户端访问/)
|
||||
assert.match(template, /:aria-label=/)
|
||||
assert.doesNotMatch(template, /第三方邮件|&#x[0-9a-f]+;/i)
|
||||
})
|
||||
@@ -24,8 +24,8 @@ for (const succeeded of [false, true]) {
|
||||
return { errorNo: 0 }
|
||||
}
|
||||
}
|
||||
const usePage = compileFunction(source + '\nreturn usePage', ['onMounted', 'ref', 'ElMessageBox', 'ElNotification', 'http'])(
|
||||
Vue.onMounted, Vue.ref, {}, value => notices.push(value), transport
|
||||
const usePage = compileFunction(source + '\nreturn usePage', ['onMounted', 'reactive', 'ref', 'ElMessageBox', 'ElNotification', 'http'])(
|
||||
Vue.onMounted, Vue.reactive, Vue.ref, {}, value => notices.push(value), transport
|
||||
)
|
||||
const { descriptor, errors } = parse(read('vue'))
|
||||
assert.deepEqual(errors, [])
|
||||
|
||||
Reference in new issue
Block a user