修复(斗鱼领取): 收敛任务物化与工作台检索
This commit is contained in:
@@ -10,6 +10,7 @@ const page = readFileSync(
|
||||
new URL('../src/pages/admin/AdminDouyuFulfillmentPage.tsx', import.meta.url),
|
||||
'utf8',
|
||||
)
|
||||
const layout = readFileSync(new URL('../src/layouts/AdminLayout.tsx', import.meta.url), 'utf8')
|
||||
|
||||
test('斗鱼领取列表必须把筛选参数直接交给 axios', () => {
|
||||
assert.match(service, /'\/api\/v1\/admin\/douyu-fulfillment\/tasks',\s*params\)/)
|
||||
@@ -22,3 +23,20 @@ test('斗鱼领取列表查询键必须包含关键词和状态', () => {
|
||||
/queryKey:\s*\['admin-douyu-fulfillment',\s*keyword,\s*status,\s*page,\s*pageSize\]/,
|
||||
)
|
||||
})
|
||||
|
||||
test('斗鱼领取搜索只在提交时触发查询,输入过程不逐字请求', () => {
|
||||
assert.match(page, /onSearch=\{\(value\)\s*=>\s*\{[\s\S]*setKeyword\(value\.trim\(\)\)/)
|
||||
assert.doesNotMatch(
|
||||
page,
|
||||
/onChange=\{\(event\)\s*=>\s*\{[\s\S]*setKeyword\(event\.target\.value\)/,
|
||||
)
|
||||
})
|
||||
|
||||
test('斗鱼实时事件必须合并刷新,不能每条 SSE 都触发列表重拉', () => {
|
||||
assert.match(layout, /DOUYU_REFRESH_DEBOUNCE_MS\s*=\s*500/)
|
||||
assert.match(layout, /invalidateDouyuQueriesSoon/)
|
||||
assert.doesNotMatch(
|
||||
layout,
|
||||
/event\.scopes\.includes\('admin_douyu_fulfillment'\)\)\s*\{\s*void queryClient\.invalidateQueries/,
|
||||
)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user