优化
This commit is contained in:
@@ -142,8 +142,20 @@ async function registrationModule() {
|
||||
report.resources.tenantId = registration.json.data.tenantId
|
||||
report.resources.membershipId = registration.json.data.membershipId
|
||||
|
||||
await apiStep('registration', 'duplicate username is rejected', {
|
||||
await apiStep('registration', 'same credentials replay the incomplete registration without creating another customer', {
|
||||
method: 'POST', path: '/api/auth/register', body: registrationBody,
|
||||
}, ({ json }) => {
|
||||
requireSuccess(json)
|
||||
for (const field of ['accountId', 'tenantId', 'membershipId']) {
|
||||
assertPresent(json.data?.[field], field)
|
||||
assertEqual(String(json.data[field]), String(registration.json.data[field]), `replayed ${field}`)
|
||||
}
|
||||
assertEqual(json.data?.tenantStatus, 'PROFILE_REQUIRED', 'replayed tenantStatus')
|
||||
})
|
||||
|
||||
await apiStep('registration', 'duplicate username with different credentials is rejected', {
|
||||
method: 'POST', path: '/api/auth/register',
|
||||
body: { ...registrationBody, password: `Different${randomUUID()}9!` },
|
||||
}, ({ json, status }) => {
|
||||
assertEqual(status, 200, 'HTTP status')
|
||||
assertEqual(String(json?.code), 'A0409', 'business code')
|
||||
|
||||
Reference in New Issue
Block a user