20 lines
869 B
TypeScript
20 lines
869 B
TypeScript
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[]'), '任务接口类型必须包含核销码数组')
|
|
})
|