统一前后端代码格式化配置
This commit is contained in:
@@ -64,43 +64,56 @@ test('resolveKuaishouFeifeiH5UrlWithUid appends uid query', () => {
|
||||
|
||||
test('buildFeifeiPlatformOrderNo prefers source order number', () => {
|
||||
assert.equal(
|
||||
buildFeifeiPlatformOrderNo(createTask({
|
||||
platform_order_id: 'KS202607080001',
|
||||
task_no: 'DT600a8bd23b8',
|
||||
})),
|
||||
buildFeifeiPlatformOrderNo(
|
||||
createTask({
|
||||
platform_order_id: 'KS202607080001',
|
||||
task_no: 'DT600a8bd23b8',
|
||||
}),
|
||||
),
|
||||
'KS202607080001',
|
||||
)
|
||||
})
|
||||
|
||||
test('buildFeifeiPlatformOrderNo falls back to task number', () => {
|
||||
assert.equal(
|
||||
buildFeifeiPlatformOrderNo(createTask({
|
||||
platform_order_id: '',
|
||||
task_no: 'DT600a8bd23b8',
|
||||
})),
|
||||
buildFeifeiPlatformOrderNo(
|
||||
createTask({
|
||||
platform_order_id: '',
|
||||
task_no: 'DT600a8bd23b8',
|
||||
}),
|
||||
),
|
||||
'DT600a8bd23b8',
|
||||
)
|
||||
})
|
||||
|
||||
test('resolveKuaishouFeifeiPlatformAmount converts order fen amount to yuan', () => {
|
||||
assert.equal(resolveKuaishouFeifeiPlatformAmount({
|
||||
totalAmountFen: 3800,
|
||||
quantity: 1,
|
||||
}), 38)
|
||||
assert.equal(
|
||||
resolveKuaishouFeifeiPlatformAmount({
|
||||
totalAmountFen: 3800,
|
||||
quantity: 1,
|
||||
}),
|
||||
38,
|
||||
)
|
||||
})
|
||||
|
||||
test('resolveKuaishouFeifeiPlatformAmount splits amount by item quantity', () => {
|
||||
assert.equal(resolveKuaishouFeifeiPlatformAmount({
|
||||
totalAmountFen: 7600,
|
||||
quantity: 2,
|
||||
}), 38)
|
||||
assert.equal(
|
||||
resolveKuaishouFeifeiPlatformAmount({
|
||||
totalAmountFen: 7600,
|
||||
quantity: 2,
|
||||
}),
|
||||
38,
|
||||
)
|
||||
})
|
||||
|
||||
test('resolveKuaishouFeifeiPlatformAmount skips empty amount', () => {
|
||||
assert.equal(resolveKuaishouFeifeiPlatformAmount({
|
||||
totalAmountFen: 0,
|
||||
quantity: 1,
|
||||
}), 0)
|
||||
assert.equal(
|
||||
resolveKuaishouFeifeiPlatformAmount({
|
||||
totalAmountFen: 0,
|
||||
quantity: 1,
|
||||
}),
|
||||
0,
|
||||
)
|
||||
})
|
||||
|
||||
function createTask(patch: Partial<TaskRow> = {}): TaskRow {
|
||||
|
||||
Reference in New Issue
Block a user