优化
This commit is contained in:
@@ -4,17 +4,22 @@ import test from 'node:test'
|
||||
|
||||
const moduleRoot = new URL('./', import.meta.url)
|
||||
|
||||
test('keeps message-center routes unreleased until the server contract is frozen', async () => {
|
||||
test('activates message-center routes with the frozen merchant permission', async () => {
|
||||
const source = await readFile(new URL('routes.ts', moduleRoot), 'utf8')
|
||||
assert.match(source, /name: 'notifications-list'[\s\S]*release: 'prototype'/)
|
||||
assert.match(source, /name: 'notification-detail'[\s\S]*release: 'prototype'/)
|
||||
assert.match(source, /name: 'notifications-list'[\s\S]*release: 'active'/)
|
||||
assert.match(source, /name: 'notification-detail'[\s\S]*release: 'active'/)
|
||||
assert.match(source, /merchant:notification:view/)
|
||||
})
|
||||
|
||||
test('does not accept browser-selected customer or user scope in the API boundary', async () => {
|
||||
const source = await readFile(new URL('api/notifications.ts', moduleRoot), 'utf8')
|
||||
assert.doesNotMatch(source, /tenantId|customerId|merchantId|userId/)
|
||||
assert.match(source, /merchant\/v1\/notifications/)
|
||||
assert.match(source, /unread-count/)
|
||||
assert.match(source, /read-all/)
|
||||
assert.match(source, /category: query\.type/)
|
||||
assert.match(source, /method: 'PUT'/)
|
||||
assert.doesNotMatch(source, /method: 'POST'/)
|
||||
})
|
||||
|
||||
test('keeps customer message actions first and covers the requested local states', async () => {
|
||||
|
||||
Reference in New Issue
Block a user