fix: restore phase five development acceptance chain
This commit is contained in:
@@ -148,7 +148,7 @@ async function registrationModule() {
|
||||
})
|
||||
|
||||
const login = await apiStep('registration', 'login before approval', {
|
||||
method: 'POST', path: '/api/auth/login', body: { username, password: clientPassword },
|
||||
method: 'POST', path: '/api/auth/login', body: { loginId: username, password: clientPassword },
|
||||
}, ({ json }) => {
|
||||
requireSuccess(json)
|
||||
assertPresent(json.data?.accessToken, 'accessToken')
|
||||
@@ -286,7 +286,7 @@ async function qualificationAndReviewModule() {
|
||||
}, ({ json }) => ({ tenantId: json.data.id, status: json.data.status }))
|
||||
|
||||
const platformLogin = await apiStep('qualification-review', 'platform reviewer login', {
|
||||
method: 'POST', path: '/api/auth/login', body: { username: platformUsername, password: platformPassword },
|
||||
method: 'POST', path: '/api/auth/login', body: { loginId: platformUsername, password: platformPassword },
|
||||
}, ({ json }) => {
|
||||
requireSuccess(json)
|
||||
assertPresent(json.data?.accessToken, 'platform accessToken')
|
||||
@@ -345,7 +345,7 @@ async function qualificationAndReviewModule() {
|
||||
|
||||
async function merchantAfterApprovalModule() {
|
||||
const login = await apiStep('merchant-session', 'client re-login after approval', {
|
||||
method: 'POST', path: '/api/auth/login', body: { username, password: clientPassword },
|
||||
method: 'POST', path: '/api/auth/login', body: { loginId: username, password: clientPassword },
|
||||
}, ({ json }) => {
|
||||
requireSuccess(json)
|
||||
assertPresent(json.data?.accessToken, 'accessToken')
|
||||
@@ -502,7 +502,7 @@ async function profileManagementModule() {
|
||||
}, ({ json }) => ({ userId: json.data.userId, username: json.data.username, displayName: json.data.displayName }))
|
||||
|
||||
const relogin = await apiStep('profile-management', 're-login after personal profile token revocation', {
|
||||
method: 'POST', path: '/api/auth/login', body: { username, password: clientPassword },
|
||||
method: 'POST', path: '/api/auth/login', body: { loginId: username, password: clientPassword },
|
||||
}, ({ json }) => {
|
||||
requireSuccess(json)
|
||||
assertPresent(json.data?.accessToken, 'accessToken')
|
||||
@@ -692,7 +692,7 @@ async function rbacAndMemberModule() {
|
||||
}, ({ json }) => ({ membershipId: report.resources.membershipId, rejectionCode: json.code }))
|
||||
|
||||
const memberLogin = await apiStep('rbac-member', 'new enterprise member can login', {
|
||||
method: 'POST', path: '/api/auth/login', body: { username: memberUsername, password: memberPassword },
|
||||
method: 'POST', path: '/api/auth/login', body: { loginId: memberUsername, password: memberPassword },
|
||||
}, ({ json }) => {
|
||||
requireSuccess(json)
|
||||
assertPresent(json.data?.accessToken, 'member accessToken')
|
||||
@@ -742,7 +742,7 @@ async function rbacAndMemberModule() {
|
||||
}, ({ json }) => ({ rejectionCode: json?.code, message: json?.message }))
|
||||
|
||||
const disabledRoleLogin = await apiStep('menu-permissions', 'member login succeeds while role is disabled', {
|
||||
method: 'POST', path: '/api/auth/login', body: { username: memberUsername, password: memberPassword },
|
||||
method: 'POST', path: '/api/auth/login', body: { loginId: memberUsername, password: memberPassword },
|
||||
}, ({ json }) => {
|
||||
requireSuccess(json)
|
||||
assertPresent(json.data?.accessToken, 'member accessToken')
|
||||
@@ -769,7 +769,7 @@ async function rbacAndMemberModule() {
|
||||
assertEqual(json.data?.status, 'ACTIVE', 'role status')
|
||||
}, ({ json }) => ({ roleId: json.data.id, status: json.data.status }))
|
||||
const enabledRoleLogin = await apiStep('menu-permissions', 'member re-login after role is enabled', {
|
||||
method: 'POST', path: '/api/auth/login', body: { username: memberUsername, password: memberPassword },
|
||||
method: 'POST', path: '/api/auth/login', body: { loginId: memberUsername, password: memberPassword },
|
||||
}, ({ json }) => {
|
||||
requireSuccess(json)
|
||||
assertPresent(json.data?.accessToken, 'member accessToken')
|
||||
@@ -800,7 +800,7 @@ async function rbacAndMemberModule() {
|
||||
}, ({ json }) => ({ rejectionCode: json?.code, message: json?.message }))
|
||||
|
||||
const reducedPermissionLogin = await apiStep('menu-permissions', 'member re-login after permission removal', {
|
||||
method: 'POST', path: '/api/auth/login', body: { username: memberUsername, password: memberPassword },
|
||||
method: 'POST', path: '/api/auth/login', body: { loginId: memberUsername, password: memberPassword },
|
||||
}, ({ json }) => {
|
||||
requireSuccess(json)
|
||||
assertPresent(json.data?.accessToken, 'member accessToken')
|
||||
@@ -824,7 +824,7 @@ async function rbacAndMemberModule() {
|
||||
body: { roleId, permissionIds },
|
||||
}, ({ json }) => requireSuccess(json), () => ({ roleId, permissionCodes: desiredCodes }))
|
||||
const restoredPermissionLogin = await apiStep('menu-permissions', 'member re-login after permission restoration', {
|
||||
method: 'POST', path: '/api/auth/login', body: { username: memberUsername, password: memberPassword },
|
||||
method: 'POST', path: '/api/auth/login', body: { loginId: memberUsername, password: memberPassword },
|
||||
}, ({ json }) => {
|
||||
requireSuccess(json)
|
||||
assertPresent(json.data?.accessToken, 'member accessToken')
|
||||
@@ -860,13 +860,13 @@ async function rbacAndMemberModule() {
|
||||
body: { newPassword: resetMemberPassword },
|
||||
}, ({ json }) => requireSuccess(json), () => ({ membershipId }))
|
||||
await apiStep('rbac-member', 'member old password is rejected after reset', {
|
||||
method: 'POST', path: '/api/auth/login', body: { username: memberUsername, password: memberPassword },
|
||||
method: 'POST', path: '/api/auth/login', body: { loginId: memberUsername, password: memberPassword },
|
||||
}, ({ json, status }) => {
|
||||
assertEqual(status, 200, 'HTTP status')
|
||||
assertEqual(String(json?.code), 'A0401', 'business code')
|
||||
}, ({ json }) => ({ username: memberUsername, rejectionCode: json.code }))
|
||||
const resetLogin = await apiStep('rbac-member', 'member can login with reset password', {
|
||||
method: 'POST', path: '/api/auth/login', body: { username: memberUsername, password: resetMemberPassword },
|
||||
method: 'POST', path: '/api/auth/login', body: { loginId: memberUsername, password: resetMemberPassword },
|
||||
}, ({ json }) => {
|
||||
requireSuccess(json)
|
||||
assertPresent(json.data?.accessToken, 'member accessToken')
|
||||
@@ -886,7 +886,7 @@ async function rbacAndMemberModule() {
|
||||
assertTrue(['A0401', 'A0403'].includes(String(json?.code)), `expected A0401/A0403, actual=${json?.code}`)
|
||||
}, ({ json }) => ({ membershipId, rejectionCode: json?.code }))
|
||||
await apiStep('rbac-member', 'disabled member login is rejected', {
|
||||
method: 'POST', path: '/api/auth/login', body: { username: memberUsername, password: resetMemberPassword },
|
||||
method: 'POST', path: '/api/auth/login', body: { loginId: memberUsername, password: resetMemberPassword },
|
||||
}, ({ json, status }) => {
|
||||
assertEqual(status, 200, 'HTTP status')
|
||||
assertTrue(['A0401', 'A0403'].includes(String(json?.code)), `expected A0401/A0403, actual=${json?.code}`)
|
||||
@@ -899,7 +899,7 @@ async function rbacAndMemberModule() {
|
||||
}, ({ json }) => ({ membershipId: json.data.membershipId, status: json.data.status }))
|
||||
|
||||
const enabledMemberLogin = await apiStep('rbac-member', 'member re-login after account is enabled', {
|
||||
method: 'POST', path: '/api/auth/login', body: { username: memberUsername, password: resetMemberPassword },
|
||||
method: 'POST', path: '/api/auth/login', body: { loginId: memberUsername, password: resetMemberPassword },
|
||||
}, ({ json }) => {
|
||||
requireSuccess(json)
|
||||
assertPresent(json.data?.accessToken, 'member accessToken')
|
||||
@@ -927,7 +927,7 @@ async function rbacAndMemberModule() {
|
||||
assertEqual(String(json?.code), 'A0401', 'business code')
|
||||
}, ({ json }) => ({ rejectionCode: json.code }))
|
||||
const noRoleLogin = await apiStep('rbac-member', 'member re-login after role clearing', {
|
||||
method: 'POST', path: '/api/auth/login', body: { username: memberUsername, password: resetMemberPassword },
|
||||
method: 'POST', path: '/api/auth/login', body: { loginId: memberUsername, password: resetMemberPassword },
|
||||
}, ({ json }) => {
|
||||
requireSuccess(json)
|
||||
assertPresent(json.data?.accessToken, 'member accessToken')
|
||||
@@ -1294,7 +1294,7 @@ async function isolationModule() {
|
||||
return
|
||||
}
|
||||
const login = await apiStep('isolation', 'existing client login', {
|
||||
method: 'POST', path: '/api/auth/login', body: { username: existingClientUsername, password: existingClientPassword },
|
||||
method: 'POST', path: '/api/auth/login', body: { loginId: existingClientUsername, password: existingClientPassword },
|
||||
}, ({ json }) => {
|
||||
requireSuccess(json)
|
||||
assertPresent(json.data?.accessToken, 'accessToken')
|
||||
@@ -1603,14 +1603,14 @@ async function accountSecurityModule() {
|
||||
ownerPasswordNeedsRestore = true
|
||||
|
||||
await apiStep('account-security', 'original password is rejected after change', {
|
||||
method: 'POST', path: '/api/auth/login', body: { username, password: clientPassword },
|
||||
method: 'POST', path: '/api/auth/login', body: { loginId: username, password: clientPassword },
|
||||
}, ({ json, status }) => {
|
||||
assertEqual(status, 200, 'HTTP status')
|
||||
assertEqual(String(json?.code), 'A0401', 'business code')
|
||||
}, ({ json }) => ({ username, rejectionCode: json.code }))
|
||||
|
||||
const temporaryLogin = await apiStep('account-security', 'temporary password login succeeds', {
|
||||
method: 'POST', path: '/api/auth/login', body: { username, password: temporaryOwnerPassword },
|
||||
method: 'POST', path: '/api/auth/login', body: { loginId: username, password: temporaryOwnerPassword },
|
||||
}, ({ json }) => {
|
||||
requireSuccess(json)
|
||||
assertPresent(json.data?.accessToken, 'accessToken')
|
||||
@@ -1625,7 +1625,7 @@ async function accountSecurityModule() {
|
||||
temporaryOwnerPassword = undefined
|
||||
|
||||
const restoredLogin = await apiStep('account-security', 'restored owner password login succeeds', {
|
||||
method: 'POST', path: '/api/auth/login', body: { username, password: clientPassword },
|
||||
method: 'POST', path: '/api/auth/login', body: { loginId: username, password: clientPassword },
|
||||
}, ({ json }) => {
|
||||
requireSuccess(json)
|
||||
assertPresent(json.data?.accessToken, 'accessToken')
|
||||
@@ -1655,7 +1655,7 @@ async function accountSecurityModule() {
|
||||
async function recoverOwnerPassword() {
|
||||
try {
|
||||
const login = await apiStep('account-security-recovery', 'login with temporary owner password for recovery', {
|
||||
method: 'POST', path: '/api/auth/login', body: { username, password: temporaryOwnerPassword },
|
||||
method: 'POST', path: '/api/auth/login', body: { loginId: username, password: temporaryOwnerPassword },
|
||||
}, ({ json }) => {
|
||||
requireSuccess(json)
|
||||
assertPresent(json.data?.accessToken, 'recovery accessToken')
|
||||
|
||||
Reference in New Issue
Block a user