import assert from 'node:assert/strict' import { readFile } from 'node:fs/promises' import test from 'node:test' test('打手退单审核第一列按订单号、店铺、商品名展示,并提供商品详情入口', async () => { const source = await readFile( new URL('../src/pages/admin/panels/CancelRequestsPanel.tsx', import.meta.url), 'utf8', ) assert.ok(source.includes("title: '订单号 / 店铺 / 商品名'")) const cellSource = source.slice( source.indexOf("title: '订单号 / 店铺 / 商品名'"), source.indexOf("title: '打手 / 份数'"), ) const platformIndex = cellSource.indexOf("{request.platformOrderId || '-'}") const shopIndex = cellSource.indexOf("{request.shopName || '-'}") const productIndex = cellSource.lastIndexOf('{productName}') assert.ok(platformIndex >= 0 && shopIndex > platformIndex && productIndex > shopIndex) assert.ok(source.includes('InfoCircleOutlined')) assert.ok(source.includes('查看商品详情')) assert.ok(source.includes('WorkOrderProductDetailDrawer')) }) test('商品详情只展示商品、金额押金、打手份数和已提交资料截图', async () => { const source = await readFile( new URL('../src/components/admin/WorkOrderProductDetailDrawer.tsx', import.meta.url), 'utf8', ) assert.ok(source.includes('基础信息')) assert.ok(source.includes('接单金额')) assert.ok(source.includes('押金')) assert.ok(source.includes('拼单')) assert.ok(source.includes('已提交商品资料')) assert.ok(source.includes('getMaterialDetailItems')) assert.ok(source.includes('getMaterialScreenshots')) assert.ok(!source.includes('WorkOrderEventTimeline')) assert.ok(!source.includes('流转记录')) assert.ok(!source.includes('原始数据')) assert.ok(!source.includes('验收信息')) })