fix(notifications): refine bell notification center

This commit is contained in:
caoxiaozhu
2026-06-03 17:16:09 +08:00
parent c73178b65d
commit 95956afbc6
5 changed files with 363 additions and 62 deletions

View File

@@ -85,6 +85,24 @@ test('document center sidebar inbox shares source scoped document keys', () => {
assert.deepEqual(rows.map((row) => resolveDocumentNewKey(row)), ['approval:claim-1', 'archive:claim-2'])
})
test('document center inbox rows expose real notification metadata', () => {
const rows = buildDocumentInboxRows({
ownedClaims: [{
id: 'claim-1',
claim_no: 'EXP-1',
title: '差旅报销',
status: 'draft',
created_at: '2026-06-03T09:10:00+08:00'
}]
})
assert.equal(rows[0].documentNo, 'EXP-1')
assert.equal(rows[0].sourceLabel, '我的单据')
assert.equal(rows[0].title, '差旅报销')
assert.equal(rows[0].createdAt, '2026-06-03T09:10:00+08:00')
assert.equal(Number.isFinite(rows[0].sortTime), true)
})
test('document center scope state restores only allowed tabs', () => {
const storage = createMemoryStorage()
const scopes = ['全部', '申请单', '报销单', '审核单', '归档']