fix(consignment): 内部现货履约文案对齐待加好友,并移除已废弃的指派打手路径
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1,7 +1,10 @@
|
||||
import assert from 'node:assert/strict'
|
||||
import test from 'node:test'
|
||||
|
||||
import { resolveConsignmentWorkerDisplay } from '../src/utils/consignment-display.ts'
|
||||
import {
|
||||
resolveConsignmentWorkerDisplay,
|
||||
resolveConsignmentScreenshotUrls,
|
||||
} from '../src/utils/consignment-display.ts'
|
||||
|
||||
test('普通工单无寄售信息时 resolveConsignmentWorkerDisplay 返回 null', () => {
|
||||
const order = {
|
||||
@@ -53,3 +56,18 @@ test('寄售工单无供货打手名时回退展示角色昵称与现货标签',
|
||||
assert.equal(result.primaryName, '客服角色')
|
||||
assert.equal(result.secondaryInfo, 'ID:1234551')
|
||||
})
|
||||
|
||||
test('寄售截图兼容字符串 URL 与 UploadedFile 对象', () => {
|
||||
assert.deepEqual(
|
||||
resolveConsignmentScreenshotUrls([
|
||||
'/api/v1/files/object?key=consignment_screenshot%2Fa.webp',
|
||||
{ url: '/api/v1/files/object?key=consignment_screenshot%2Fb.webp' },
|
||||
{ objectKey: 'x', url: '' },
|
||||
12,
|
||||
]),
|
||||
[
|
||||
'/api/v1/files/object?key=consignment_screenshot%2Fa.webp',
|
||||
'/api/v1/files/object?key=consignment_screenshot%2Fb.webp',
|
||||
],
|
||||
)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user