feat(fulfillment): 自动核销任务展示并搜索核销码
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
import assert from 'node:assert/strict'
|
||||
import { readFileSync } from 'node:fs'
|
||||
import test from 'node:test'
|
||||
|
||||
test('自动核销最近任务展示并搜索核销码', () => {
|
||||
const page = readFileSync(
|
||||
new URL('../src/pages/admin/panels/VoucherConsumePolicyPanel.tsx', import.meta.url).pathname,
|
||||
'utf8',
|
||||
)
|
||||
const service = readFileSync(
|
||||
new URL('../src/services/admin/fulfillment-channel.ts', import.meta.url).pathname,
|
||||
'utf8',
|
||||
)
|
||||
|
||||
assert.ok(page.includes("title: '核销码'"), '最近核销任务必须展示核销码列')
|
||||
assert.ok(page.includes('copyable={{ text: code }}'), '核销码必须支持一键复制')
|
||||
assert.ok(page.includes('任务号 / 订单号 / 平台单号 / 核销码'), '搜索框必须明确支持核销码')
|
||||
assert.ok(service.includes('voucher_codes: string[]'), '任务接口类型必须包含核销码数组')
|
||||
})
|
||||
@@ -8,7 +8,7 @@ const panel = readFileSync(
|
||||
)
|
||||
|
||||
test('最近核销任务提供关键词、平台、渠道和状态筛选', () => {
|
||||
assert.ok(panel.includes('placeholder="任务号 / 订单号 / 平台单号"'))
|
||||
assert.ok(panel.includes('placeholder="任务号 / 订单号 / 平台单号 / 核销码"'))
|
||||
assert.ok(panel.includes('placeholder="全部平台"'))
|
||||
assert.ok(panel.includes('placeholder="全部渠道"'))
|
||||
assert.ok(panel.includes('placeholder="全部状态"'))
|
||||
|
||||
Reference in New Issue
Block a user