补全历史履约通道优先级
This commit is contained in:
@@ -6,6 +6,18 @@ import {
|
||||
resolveFulfillmentRoute,
|
||||
} from './routing-config-service.js'
|
||||
|
||||
test('normalizeFulfillmentRoutingConfig adds channels missing from historical priority configs', () => {
|
||||
const config = normalizeFulfillmentRoutingConfig({
|
||||
defaultExecutorPriority: ['kuaishou_ct_assisted', 'kuaishou_feifei'],
|
||||
})
|
||||
|
||||
assert.deepEqual(config.defaultExecutorPriority, [
|
||||
'kuaishou_ct_assisted',
|
||||
'kuaishou_feifei',
|
||||
'affiliate_dash',
|
||||
])
|
||||
})
|
||||
|
||||
test('resolveFulfillmentRoute 总开关关闭后不再回退默认配置,返回未选中', () => {
|
||||
const result = resolveFulfillmentRoute({
|
||||
productName: '测试商品',
|
||||
|
||||
@@ -440,6 +440,14 @@ function normalizeExecutorPriority(value: unknown) {
|
||||
items.push(executorKey)
|
||||
}
|
||||
|
||||
// 历史配置不会自动拥有后来新增的履约通道;补全默认通道,开关仍由 executors 控制。
|
||||
for (const executorKey of DEFAULT_EXECUTOR_PRIORITY) {
|
||||
if (!seen.has(executorKey)) {
|
||||
seen.add(executorKey)
|
||||
items.push(executorKey)
|
||||
}
|
||||
}
|
||||
|
||||
return items
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user