补齐已发送邮件密送名单展示并保持收件隐私

This commit is contained in:
xuans committed 2026-10-03 21:35:41 +08:00
1 parent d4808da159
commit 8b83fa380a
3 files changed
+57

No files matched your search

+38
View File
@@ -79,6 +79,44 @@ test('异常地址和附件字段不导致页面异常,切换邮件清除旧
assert.equal(page.showCC.value, false)
})
test('仅发件副本展示密送名单,切换到收件副本立即清除', async () => {
const addresses = '[{"Name":"","EmailAddress":"hidden@example.com"}]'
const {page, route} = fixture(async (_, {id}) => ({
errorNo: 0,
data: {...email(id).data, type: id === 15 ? 1 : 0, bcc: addresses}
}))
await settle()
assert.equal(page.showBCC.value, true)
assert.equal(page.bccs.value[0].EmailAddress, 'hidden@example.com')
route.params.id = '16'
await settle()
assert.equal(page.showBCC.value, false)
assert.deepEqual(page.bccs.value, [])
})
test('未知邮件类型和无效密送字段不展示名单,加载失败不残留旧名单', async () => {
for (const data of [
{bcc: '[{"EmailAddress":"hidden@example.com"}]'},
{type: 1, bcc: '{'},
{type: 1, bcc: 'null'},
{type: 1, bcc: '[]'}
]) {
const {page} = fixture(async () => ({errorNo: 0, data: {...email(15).data, ...data}}))
await settle()
assert.equal(page.showBCC.value, false)
assert.deepEqual(page.bccs.value, [])
}
const {page, route} = fixture(async (_, {id}) => id === 15
? {errorNo: 0, data: {...email(id).data, type: 1, bcc: '[{"EmailAddress":"hidden@example.com"}]'}}
: {errorNo: 403, errorMsg: '无权查看邮件'})
await settle()
assert.equal(page.showBCC.value, true)
route.params.id = '16'
await settle()
assert.equal(page.showBCC.value, false)
assert.deepEqual(page.bccs.value, [])
})
test('切换邮件后旧请求成功或失败均不能覆盖新邮件', async () => {
for (const staleFailure of [false, true]) {
let finish