feat(consignment): 寄售仓库增加入库时间筛选
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
import assert from 'node:assert/strict'
|
||||
import { readFileSync } from 'node:fs'
|
||||
import test from 'node:test'
|
||||
|
||||
test('寄售仓库必须提供通过审核入库时间范围筛选,并透传到库存查询', () => {
|
||||
const source = readFileSync(
|
||||
new URL('../src/pages/admin/panels/ConsignmentInventoryPanel.tsx', import.meta.url).pathname,
|
||||
'utf8',
|
||||
)
|
||||
|
||||
assert.ok(
|
||||
source.includes("from '@/components/admin/AdminDatePicker'"),
|
||||
'必须复用后台日期范围控件',
|
||||
)
|
||||
assert.ok(source.includes("placeholder={['入库开始日期', '入库结束日期']}"), '必须明确筛选口径')
|
||||
assert.ok(source.includes('dateFrom: inboundRange?.[0]'), '开始日期必须透传后端')
|
||||
assert.ok(source.includes('dateTo: inboundRange?.[1]'), '结束日期必须透传后端')
|
||||
assert.ok(
|
||||
source.includes('inboundRange?.[0],\n inboundRange?.[1],'),
|
||||
'日期变化必须进入 React Query key 并触发重新查询',
|
||||
)
|
||||
assert.ok(
|
||||
source
|
||||
.slice(source.indexOf('<AdminRangePicker'), source.indexOf('<Input.Search'))
|
||||
.includes('setPage(1)'),
|
||||
'修改日期筛选后必须回到第一页',
|
||||
)
|
||||
})
|
||||
Reference in New Issue
Block a user