feat:寄卖增加对接客服,db脚本迁移修复
This commit is contained in:
@@ -3,20 +3,14 @@ import test from 'node:test'
|
||||
|
||||
import { formatConsignmentContactSupporter } from '../src/utils/consignment-contact.ts'
|
||||
|
||||
test('对接客服:姓名 + 电话/微信一起展示', () => {
|
||||
const display = formatConsignmentContactSupporter({
|
||||
contactSupporterName: '小张',
|
||||
contactSupporterPhone: '13800001111',
|
||||
contactSupporterWechat: 'wx_zhang',
|
||||
})
|
||||
test('对接客服:展示姓名', () => {
|
||||
const display = formatConsignmentContactSupporter({ contactSupporterName: '小张' })
|
||||
assert.equal(display.name, '小张')
|
||||
assert.equal(display.contact, '电话 13800001111 · 微信 wx_zhang')
|
||||
assert.equal(display.text, '小张 · 电话 13800001111 · 微信 wx_zhang')
|
||||
assert.equal(display.text, '小张')
|
||||
})
|
||||
|
||||
test('对接客服:只有姓名时不拼联系方式', () => {
|
||||
const display = formatConsignmentContactSupporter({ contactSupporterName: '小李' })
|
||||
assert.equal(display.text, '小李')
|
||||
test('对接客服:姓名首尾空白会被清理', () => {
|
||||
assert.equal(formatConsignmentContactSupporter({ contactSupporterName: ' 小李 ' }).text, '小李')
|
||||
})
|
||||
|
||||
test('对接客服:历史数据没有姓名时回退为未指定', () => {
|
||||
|
||||
Reference in New Issue
Block a user