优化
This commit is contained in:
@@ -7,11 +7,12 @@ import { fileURLToPath } from 'node:url'
|
||||
const scriptsDir = dirname(fileURLToPath(import.meta.url))
|
||||
const source = readFileSync(resolve(scriptsDir, 'client-test-env-acceptance.mjs'), 'utf8')
|
||||
|
||||
test('Client full acceptance executes the real notification inbox flow', () => {
|
||||
const isolation = source.indexOf('await isolationModule()')
|
||||
const notifications = source.indexOf('await notificationInboxModule()')
|
||||
const security = source.indexOf('await accountSecurityModule()')
|
||||
assert.ok(isolation >= 0 && notifications > isolation && security > notifications)
|
||||
test('fixed customer acceptance excludes notification writes and reports incomplete coverage', () => {
|
||||
const orchestration = source.match(/try\s*\{\s*await reuseFixedClient\(\)[\s\S]*?\} catch \(error\)/)?.[0] || ''
|
||||
assert.match(orchestration, /'notification-inbox'/)
|
||||
assert.match(orchestration, /recordSkipped\(module,/)
|
||||
assert.doesNotMatch(orchestration, /await (?:isolationModule|notificationInboxModule|accountSecurityModule)\(/)
|
||||
assert.match(orchestration, /report\.fullCoverage = !report\.steps\.some\(\(step\) => step\.skipped\)/)
|
||||
assert.match(source, /async function notificationInboxModule\(\)/)
|
||||
for (const permission of [
|
||||
'merchant:notification:view',
|
||||
@@ -20,7 +21,7 @@ test('Client full acceptance executes the real notification inbox flow', () => {
|
||||
]) assert.match(source, new RegExp(`['"]${permission}['"]`))
|
||||
})
|
||||
|
||||
test('notification delivery targets only the newly registered customer owner', () => {
|
||||
test('excluded notification lifecycle targets only its fixture customer owner', () => {
|
||||
assert.match(source, /tenantId:\s*String\(report\.resources\.tenantId\)/)
|
||||
assert.match(source, /recipientType:\s*['"]MEMBERSHIP['"]/)
|
||||
assert.match(source, /recipientIds:\s*\[String\(report\.resources\.membershipId\)\]/)
|
||||
|
||||
Reference in New Issue
Block a user