隔离系统通知配置权限并保留各角色个人设置

个人扫码绑定实现前检查点;补充权限与账户隔离回归用例,业务实机验收尚未执行。
This commit is contained in:
xuans committed 2026-09-28 20:57:56 +08:00
1 parent 890660cf38
commit 8104998417
9 files changed
+196 -19

No files matched your search

+10 -1
View File
@@ -55,10 +55,19 @@ function fixture(get, pageKey = 'base', options = {}) {
get: path => path.endsWith('/pending') && !options.pendingGet ? Promise.resolve({ errorNo: 0, data: null }) : get(path),
...options.http
},
() => ({ hasCapability: options.hasCapability || (() => true) }), pageKey, callback => { dispose = callback })
() => ({ role: options.role || 'super_admin', hasCapability: options.hasCapability || (() => true) }), pageKey, callback => { dispose = callback })
return { page, messages, successes, dispose: () => dispose() }
}
for (const pageKey of ['telegram_push', 'wechat_push']) {
for (const role of ['super_admin', 'admin', 'user']) {
test(`${role} 的 ${pageKey} 系统配置写权限只对超级管理员开放`, () => {
const { page } = fixture(async () => ({ errorNo: 0, data: {} }), pageKey, { role })
assert.equal(page.canWrite.value, role === 'super_admin')
})
}
}
function deferred() {
let resolve
let reject