style: reformat smart-match-pool.test.ts with repo prettier config (#1899 #1900)
CI/CD Pipeline / Check if frontend-only change (pull_request) Successful in 3s
CI/CD Pipeline / Dedup Check - skip PR tests when covered by push pipeline (pull_request) Successful in 4s
CI/CD Pipeline / PR Build Web Image (pull_request) Successful in 49s
CI/CD Pipeline / Frontend Lint (pull_request) Successful in 1m24s
PR Automation / Auto Approve on CI Green (pull_request) Successful in 1m29s
Preview Deploy / Deploy Preview Environment (pull_request) Successful in 1m47s
CI/CD Pipeline / Frontend Unit Tests (pull_request) Failing after 2m4s
AI Code Review / AI Code Review (pull_request) Successful in 6m33s
CI/CD Pipeline / Validate - Style (pull_request) Successful in 10m8s
CI/CD Pipeline / Validate - Security (pull_request) Has been cancelled
CI/CD Pipeline / Validate - Python (mypy + alembic) (pull_request) Has been cancelled
CI/CD Pipeline / Build Production API Image (pull_request) Has been cancelled
CI/CD Pipeline / Build Production Web Image (pull_request) Has been cancelled
CI/CD Pipeline / Build Production Worker Image (pull_request) Has been cancelled
CI/CD Pipeline / Deploy Production (pull_request) Has been cancelled
CI/CD Pipeline / Production Browser E2E (pull_request) Has been cancelled
CI/CD Pipeline / Canary Release to Production (pull_request) Has been cancelled
CI/CD Pipeline / CI Gate (pull_request) Has been cancelled
PR Automation / Auto Merge on CI Green + Approved (pull_request) Has been cancelled
CI/CD Pipeline / Retag skipped Staging Worker Image (pull_request) Failing after 41h45m23s
CI/CD Pipeline / Build Staging API Image (pull_request) Failing after 41h45m31s
CI/CD Pipeline / PR Build Worker Image (pull_request) Failing after 41h44m53s
CI/CD Pipeline / Staging E2E Tests (pull_request) Failing after 41h44m46s
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (pull_request) Failing after 41h44m51s
CI/CD Pipeline / Retag skipped Staging Web Image (pull_request) Failing after 41h44m53s
CI/CD Pipeline / Retag skipped Staging API Image (pull_request) Failing after 41h44m53s
CI/CD Pipeline / Build Staging Worker Image (pull_request) Failing after 41h45m0s
CI/CD Pipeline / Build Staging Web Image (pull_request) Failing after 41h45m1s
CI/CD Pipeline / ACR Image Cleanup (pull_request) Failing after 41h44m45s
CI/CD Pipeline / Staging API Integration Tests (pull_request) Failing after 41h44m46s
CI/CD Pipeline / Integration Tests (pull_request) Failing after 41h44m54s
CI/CD Pipeline / Unit Tests (pull_request) Failing after 41h44m54s
CI/CD Pipeline / Check push changed paths (pull_request) Failing after 41h45m4s
CI/CD Pipeline / PR Build API Image (pull_request) Failing after 42h20m20s
CI/CD Pipeline / Check if frontend-only change (pull_request) Successful in 3s
CI/CD Pipeline / Dedup Check - skip PR tests when covered by push pipeline (pull_request) Successful in 4s
CI/CD Pipeline / PR Build Web Image (pull_request) Successful in 49s
CI/CD Pipeline / Frontend Lint (pull_request) Successful in 1m24s
PR Automation / Auto Approve on CI Green (pull_request) Successful in 1m29s
Preview Deploy / Deploy Preview Environment (pull_request) Successful in 1m47s
CI/CD Pipeline / Frontend Unit Tests (pull_request) Failing after 2m4s
AI Code Review / AI Code Review (pull_request) Successful in 6m33s
CI/CD Pipeline / Validate - Style (pull_request) Successful in 10m8s
CI/CD Pipeline / Validate - Security (pull_request) Has been cancelled
CI/CD Pipeline / Validate - Python (mypy + alembic) (pull_request) Has been cancelled
CI/CD Pipeline / Build Production API Image (pull_request) Has been cancelled
CI/CD Pipeline / Build Production Web Image (pull_request) Has been cancelled
CI/CD Pipeline / Build Production Worker Image (pull_request) Has been cancelled
CI/CD Pipeline / Deploy Production (pull_request) Has been cancelled
CI/CD Pipeline / Production Browser E2E (pull_request) Has been cancelled
CI/CD Pipeline / Canary Release to Production (pull_request) Has been cancelled
CI/CD Pipeline / CI Gate (pull_request) Has been cancelled
PR Automation / Auto Merge on CI Green + Approved (pull_request) Has been cancelled
CI/CD Pipeline / Retag skipped Staging Worker Image (pull_request) Failing after 41h45m23s
CI/CD Pipeline / Build Staging API Image (pull_request) Failing after 41h45m31s
CI/CD Pipeline / PR Build Worker Image (pull_request) Failing after 41h44m53s
CI/CD Pipeline / Staging E2E Tests (pull_request) Failing after 41h44m46s
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (pull_request) Failing after 41h44m51s
CI/CD Pipeline / Retag skipped Staging Web Image (pull_request) Failing after 41h44m53s
CI/CD Pipeline / Retag skipped Staging API Image (pull_request) Failing after 41h44m53s
CI/CD Pipeline / Build Staging Worker Image (pull_request) Failing after 41h45m0s
CI/CD Pipeline / Build Staging Web Image (pull_request) Failing after 41h45m1s
CI/CD Pipeline / ACR Image Cleanup (pull_request) Failing after 41h44m45s
CI/CD Pipeline / Staging API Integration Tests (pull_request) Failing after 41h44m46s
CI/CD Pipeline / Integration Tests (pull_request) Failing after 41h44m54s
CI/CD Pipeline / Unit Tests (pull_request) Failing after 41h44m54s
CI/CD Pipeline / Check push changed paths (pull_request) Failing after 41h45m4s
CI/CD Pipeline / PR Build API Image (pull_request) Failing after 42h20m20s
This commit is contained in:
@@ -4,30 +4,30 @@
|
||||
* #1899 简化后:候选池 = 片段数(clipCount) × 3
|
||||
* 结果钳制到 [1, 200](后端 limit 上限 200);clipCount <= 0 时兜底 30。
|
||||
*/
|
||||
import { describe, it, expect } from "vitest";
|
||||
import { computeLimitFromClipCount } from "@/pages/generate/hooks/step2-materials/useSmartMatch";
|
||||
import { describe, it, expect } from "vitest"
|
||||
import { computeLimitFromClipCount } from "@/pages/generate/hooks/step2-materials/useSmartMatch"
|
||||
|
||||
describe("computeLimitFromClipCount (#1899 候选池 = 片段数×3)", () => {
|
||||
it("clipCount <= 0 时返回兜底 30", () => {
|
||||
expect(computeLimitFromClipCount(0)).toBe(30);
|
||||
expect(computeLimitFromClipCount(-1)).toBe(30);
|
||||
});
|
||||
expect(computeLimitFromClipCount(0)).toBe(30)
|
||||
expect(computeLimitFromClipCount(-1)).toBe(30)
|
||||
})
|
||||
|
||||
it("候选池 = 片段数 × 3", () => {
|
||||
expect(computeLimitFromClipCount(1)).toBe(3);
|
||||
expect(computeLimitFromClipCount(3)).toBe(9);
|
||||
expect(computeLimitFromClipCount(5)).toBe(15);
|
||||
expect(computeLimitFromClipCount(10)).toBe(30);
|
||||
});
|
||||
expect(computeLimitFromClipCount(1)).toBe(3)
|
||||
expect(computeLimitFromClipCount(3)).toBe(9)
|
||||
expect(computeLimitFromClipCount(5)).toBe(15)
|
||||
expect(computeLimitFromClipCount(10)).toBe(30)
|
||||
})
|
||||
|
||||
it("超过上限钳制为 200(后端 limit 上限)", () => {
|
||||
expect(computeLimitFromClipCount(67)).toBe(200); // 67×3=201 → 200
|
||||
expect(computeLimitFromClipCount(100)).toBe(200); // 100×3=300 → 200
|
||||
});
|
||||
expect(computeLimitFromClipCount(67)).toBe(200) // 67×3=201 → 200
|
||||
expect(computeLimitFromClipCount(100)).toBe(200) // 100×3=300 → 200
|
||||
})
|
||||
|
||||
it("任何正数片段数下 limit 均 ≥ 1", () => {
|
||||
for (let n = 1; n <= 10; n++) {
|
||||
expect(computeLimitFromClipCount(n)).toBeGreaterThanOrEqual(1);
|
||||
expect(computeLimitFromClipCount(n)).toBeGreaterThanOrEqual(1)
|
||||
}
|
||||
});
|
||||
});
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user