Files
crawler-plugin/admin-frontend-vue/tests/appearance-patent-clean-filter.test.ts
T

21 lines
1.3 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/**
* 外观专利无侵权数据页筛选纯函数(v1.3 AC-5)—— Pending Phase 3。
*
* Phase 3 组 B 落 `src/pages/patent/appearance-patent-clean-filter.ts`(照 dedupe-total-filter.ts
* 拆分:createAppearancePatentCleanFilterState / appearancePatentCleanFilterActive /
* toAppearancePatentCleanListParams)后,把下面两条 todo 转成真用例并移除 todo 标记:
*
* 1. **snake 参数形状**:toAppearancePatentCleanListParams({...}) 产出
* `page`/`page_size`(默认 10、上限 100)、`task_id`、`asin`、`country`、
* `start_date`/`end_date`(ISO yyyy-MM-dd;空白不下发)——与后端 §3.2 参数归一逐字对撞;
* 2. **分页钳制**(铁律 15):page < 1 归 1;page_size 上限 100;
* `(page-1)*page_size` 溢出边界样本(page 极大值不得把乘积顶成负数/溢出)。
*
* 跑法:`node --test tests/appearance-patent-clean-filter.test.ts`(node --test 只收顶层
* `tests/*.test.ts`,不递归;纯函数零依赖可直测)
*/
import { test } from 'node:test'
test.todo('Pending Phase 3: AC-5 筛选参数——snake page/page_size/task_id/asin/country/start_date/end_date 形状')
test.todo('Pending Phase 3: AC-5 筛选参数——page 钳制防 (page-1)*page_size 溢出(铁律 15)')