优化
This commit is contained in:
@@ -28,23 +28,32 @@ test('does not accept browser-selected customer or user scope in the API boundar
|
||||
|
||||
test('keeps customer message actions first and covers the requested local states', async () => {
|
||||
const source = await readFile(new URL('views/NotificationsView.vue', moduleRoot), 'utf8')
|
||||
const operationColumn = source.indexOf('label="操作"')
|
||||
const titleColumn = source.indexOf('label="消息标题"')
|
||||
const operationColumn = source.indexOf("label: '操作'")
|
||||
const titleColumn = source.indexOf("label: '消息标题'")
|
||||
assert.ok(operationColumn >= 0 && operationColumn < titleColumn)
|
||||
assert.match(source, /全部标为已读/)
|
||||
assert.match(source, /标为已读/)
|
||||
assert.match(source, /state-panel--error/)
|
||||
assert.match(source, /notification-state--error/)
|
||||
assert.match(source, /暂无消息/)
|
||||
assert.doesNotMatch(source, /清空已读|删除消息/)
|
||||
assert.match(source, /Promise\.all\(\[load\(\), notifications\.refreshUnreadCount\(\)\]\)/)
|
||||
assert.match(source, /auth\.hasPermission\('merchant:notification:read'\)/)
|
||||
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, /canMarkRead\.value && row\.status === 'UNREAD'/)
|
||||
assert.match(source, /notificationCategoryLabel\(row\.type\)/)
|
||||
assert.match(source, /notificationSentAt\(row\.sentAt\)/)
|
||||
})
|
||||
|
||||
test('uses the shared compact list language without a repeated page hero', async () => {
|
||||
const source = await readFile(new URL('views/NotificationsView.vue', moduleRoot), 'utf8')
|
||||
assert.match(source, /<QueryToolbar[^>]*layout="grid"/)
|
||||
assert.match(source, /<DataTable[^>]*:row-actions="rowActions"/)
|
||||
assert.match(source, /#toolbar-actions/)
|
||||
assert.match(source, /empty-text="暂无消息"/)
|
||||
assert.doesNotMatch(source, /#toolbar>|page-heading|eyebrow|table-empty|共 \{\{ total \}\} 条/)
|
||||
})
|
||||
|
||||
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: '订单消息'/)
|
||||
|
||||
Reference in New Issue
Block a user