feat(cost-center): 支持删除第三方卡券商品
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
import assert from 'node:assert/strict'
|
||||
import { readFile } from 'node:fs/promises'
|
||||
import test from 'node:test'
|
||||
|
||||
test('第三方卡券面板提供安全删除入口并格式化生效时间', async () => {
|
||||
const [panel, service] = await Promise.all([
|
||||
readFile(
|
||||
new URL('../src/pages/admin/cost-center/VoucherSkuPanel.tsx', import.meta.url),
|
||||
'utf8',
|
||||
),
|
||||
readFile(new URL('../src/services/admin/cost-center.ts', import.meta.url), 'utf8'),
|
||||
])
|
||||
|
||||
assert.ok(panel.includes('deleteAdminVoucherProduct'))
|
||||
assert.ok(panel.includes('DeleteOutlined'))
|
||||
assert.ok(panel.includes('Popconfirm'))
|
||||
assert.ok(panel.includes('已有历史订单或成本快照时会自动归档'))
|
||||
assert.ok(panel.includes('formatAdminDateTime(value)'))
|
||||
assert.ok(service.includes('/api/v1/admin/cost-center/voucher-products/${productId}'))
|
||||
assert.ok(service.includes("action: 'deleted' | 'archived'"))
|
||||
})
|
||||
Reference in New Issue
Block a user