test: align manual booking list dependencies
This commit is contained in:
@@ -16,14 +16,22 @@ const CONFIGURED_MODULES = ['merchant-qualification-fixture', 'customers', 'over
|
||||
|
||||
export function normalizeModuleOrder(modules) {
|
||||
const normalized = [...modules]
|
||||
const manualGroups = ['order-inbound-status-fixtures', 'manual-state-loading-pda', 'manual-state-ocean-trucking']
|
||||
const firstManualGroupIndex = normalized.findIndex((name) => manualGroups.includes(name))
|
||||
if (!normalized.includes('manual-state-matrix') && firstManualGroupIndex >= 0) {
|
||||
normalized.splice(firstManualGroupIndex, 0, 'manual-state-matrix')
|
||||
}
|
||||
const manualMatrixIndex = normalized.indexOf('manual-state-matrix')
|
||||
if (manualMatrixIndex >= 0) {
|
||||
const internalGroupIndex = normalized.indexOf('order-inbound-status-fixtures')
|
||||
if (internalGroupIndex >= 0) normalized.splice(internalGroupIndex, 1)
|
||||
for (const group of manualGroups) {
|
||||
const internalGroupIndex = normalized.indexOf(group)
|
||||
if (internalGroupIndex >= 0) normalized.splice(internalGroupIndex, 1)
|
||||
}
|
||||
const prerequisites = [
|
||||
'merchant-qualification-fixture',
|
||||
'phase3-container-loading',
|
||||
'phase3-loading',
|
||||
'ocean-bookings',
|
||||
'phase3-customs',
|
||||
'phase3-loading-finalize',
|
||||
]
|
||||
@@ -33,6 +41,20 @@ export function normalizeModuleOrder(modules) {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (normalized.includes('phase3-order-splitting')) {
|
||||
const prerequisites = ['merchant-qualification-fixture', 'phase3-container-loading', 'phase3-loading']
|
||||
for (const prerequisite of prerequisites) {
|
||||
if (!normalized.includes(prerequisite)) {
|
||||
normalized.splice(normalized.indexOf('phase3-order-splitting'), 0, prerequisite)
|
||||
}
|
||||
}
|
||||
const splitIndex = normalized.indexOf('phase3-order-splitting')
|
||||
const loadingIndex = normalized.indexOf('phase3-loading')
|
||||
if (splitIndex < loadingIndex) {
|
||||
normalized.splice(splitIndex, 1)
|
||||
normalized.splice(normalized.indexOf('phase3-loading') + 1, 0, 'phase3-order-splitting')
|
||||
}
|
||||
}
|
||||
if (normalized.includes('fee-items')) {
|
||||
const prerequisites = ['merchant-qualification-fixture', 'orders']
|
||||
const feeItemsIndex = normalized.indexOf('fee-items')
|
||||
|
||||
Reference in New Issue
Block a user