优化
This commit is contained in:
@@ -29,6 +29,29 @@ test('fixed Client authenticates and verifies ownership without registration', a
|
||||
await assert.rejects(scope.reuseFixedClient(), /fixed customer identity/)
|
||||
})
|
||||
|
||||
test('固定客户补回企业资料、资质及角色成员查询,全程只读且校验归属', async () => {
|
||||
const calls = []
|
||||
const scope = vm.createContext({ fixedCustomerId: '123', merchantToken: 'existing-session', report: {},
|
||||
assertEqual: assert.equal, assertTrue: assert.ok,
|
||||
requireSuccess: json => assert.equal(json.code, 200),
|
||||
async apiStep(_module, _name, request, validate) {
|
||||
calls.push(request)
|
||||
assert.equal(request.method, 'GET')
|
||||
assert.equal(request.token, 'existing-session')
|
||||
const json = { code: 200, data: request.path.endsWith('/tenant/profile')
|
||||
? { id: '123', status: 'ACTIVE' } : [] }
|
||||
validate({ json }); return { json }
|
||||
},
|
||||
})
|
||||
const helper = source.slice(source.indexOf('async function fixedClientReadOnlyModule()'), source.indexOf('async function registrationModule()'))
|
||||
vm.runInContext(helper, scope)
|
||||
await scope.fixedClientReadOnlyModule()
|
||||
assert.equal(calls.length, 6)
|
||||
assert.deepEqual([...scope.report.readOnlyCoverage], ['qualification-review', 'profile-management', 'rbac-members'])
|
||||
scope.fixedCustomerId = '999'
|
||||
await assert.rejects(scope.fixedClientReadOnlyModule(), /fixed customer read-only identity/)
|
||||
})
|
||||
|
||||
test('client registration distinguishes incomplete-registration replay from credential conflicts', () => {
|
||||
assert.match(source, /same credentials replay the incomplete registration/)
|
||||
assert.match(source, /\['accountId', 'tenantId', 'membershipId'\]/)
|
||||
|
||||
Reference in New Issue
Block a user