tweaks
This commit is contained in:
@@ -280,6 +280,34 @@ async function run(port) {
|
||||
assert(paid.status === 200 && paid.json.data.paymentType === 'lease', 'lease payment failed');
|
||||
assert(paid.json.data.stageLogDates.paymentApproved, 'payment stage log missing');
|
||||
|
||||
for (const stage of ['orderedByCustomer', 'documentsProcessed']) {
|
||||
const stepped = await request(port, 'PATCH', '/api/stocks/CH-RED/stage', {
|
||||
token: dealerToken,
|
||||
body: { stage },
|
||||
});
|
||||
assert(stepped.status === 200, `CH-RED stage ${stage} failed`);
|
||||
}
|
||||
const bothMissingName = await request(port, 'PATCH', '/api/stocks/CH-RED/stage', {
|
||||
token: dealerToken,
|
||||
body: { stage: 'paymentApproved', paymentType: 'lease', leaseProviderType: 'both' },
|
||||
});
|
||||
assert(bothMissingName.status === 400, 'both lease options should require a finance company');
|
||||
const bothPaid = await request(port, 'PATCH', '/api/stocks/CH-RED/stage', {
|
||||
token: dealerToken,
|
||||
body: {
|
||||
stage: 'paymentApproved',
|
||||
paymentType: 'lease',
|
||||
leaseProviderType: 'both',
|
||||
financeCompanyName: 'GCI Finance',
|
||||
},
|
||||
});
|
||||
assert(
|
||||
bothPaid.status === 200 &&
|
||||
bothPaid.json.data.leaseProviderType === 'both' &&
|
||||
bothPaid.json.data.financeCompanyName === 'GCI Finance',
|
||||
'lease with both GCI and finance failed'
|
||||
);
|
||||
|
||||
const outside = await request(port, 'POST', '/api/stocks/CH-YELLOW/transfer', {
|
||||
token: repToken,
|
||||
body: { dealerId: dealerC.json.data.id },
|
||||
|
||||
Reference in New Issue
Block a user