test: refresh merchant token before PDA handoff
This commit is contained in:
@@ -29,6 +29,8 @@ test('receiving hands off only transient credentials and completed warehouse fac
|
||||
assert.match(receivingSource, /context\.context\.phase4OverseasPdaOperations = \{/)
|
||||
assert.match(receivingSource, /completedFixtures: \[\]/)
|
||||
assert.match(receivingSource, /merchantToken,/)
|
||||
assert.match(receivingSource, /const refreshedMerchantToken = await loginMerchantForNegativeProbe\(context\)/)
|
||||
assert.match(receivingSource, /phase4OverseasPdaOperations\.merchantToken = refreshedMerchantToken/)
|
||||
assert.match(receivingSource, /if \(!handoffReady\) \{[\s\S]*await cleanup\(\)/)
|
||||
assert.doesNotMatch(receivingSource, /createdResources\.phase4OverseasPdaOperations/)
|
||||
assert.doesNotMatch(receivingSource, /primary: primary \? \{[^}]*password/)
|
||||
|
||||
@@ -917,6 +917,10 @@ export async function run(context) {
|
||||
context.createdResources.phase4OverseasPda.completedContainers.push(producer?.containerNo || null)
|
||||
}
|
||||
}
|
||||
const refreshedMerchantToken = await loginMerchantForNegativeProbe(context)
|
||||
if (nonBlank(refreshedMerchantToken)) {
|
||||
context.context.phase4OverseasPdaOperations.merchantToken = refreshedMerchantToken
|
||||
}
|
||||
handoffReady = context.context.phase4OverseasPdaOperations.completedFixtures.length > 0
|
||||
} finally {
|
||||
delete context.pdaContainerSuffix
|
||||
|
||||
Reference in New Issue
Block a user