This commit is contained in:
2026-08-17 19:52:08 +08:00
parent c6a1bcf611
commit 0f352bbdf9
14 changed files with 142 additions and 33 deletions
@@ -41,6 +41,17 @@ test('keeps customer message actions first and covers the requested local states
assert.match(source, /auth\.hasPermission\('merchant:notification:read-all'\)/)
assert.match(source, /v-if="canMarkAllRead"/)
assert.match(source, /v-if="canMarkRead && row\.status === 'UNREAD'"/)
assert.match(source, /notificationCategoryLabel\(row\.type\)/)
assert.match(source, /notificationSentAt\(row\.sentAt\)/)
})
test('uses friendly notification values while keeping unknown server codes visible', async () => {
const source = await readFile(new URL('presentation.ts', moduleRoot), 'utf8')
assert.match(source, /ORDER: '订单消息'/)
assert.match(source, /CLIENT_ACCEPTANCE: '验收消息'/)
assert.match(source, /categoryLabels\[code\.toUpperCase\(\)\] \?\? code/)
assert.match(source, /Number\.isNaN\(parsed\.getTime\(\)\).*return source/s)
assert.match(source, /toLocaleString\('zh-CN', \{ hour12: false \}\)/)
})
test('keeps detail readable without read permission and isolates auto-read failures', async () => {
@@ -50,6 +61,8 @@ test('keeps detail readable without read permission and isolates auto-read failu
assert.match(source, /readErrorMessage\.value=/)
assert.match(source, /v-if="readErrorMessage"/)
assert.match(source, /detail\.value=null;errorMessage\.value=/)
assert.match(source, /notificationSentAt\(detail\?\.sentAt\)/)
assert.match(source, /notificationCategoryLabel\(detail\?\.type\)/)
})
test('maps all three notification authorities into the client session', async () => {