fix(files,test): probe requires organize.execute; rename duplicate E6 to E10; trash approval replay test
- POST /files/probe writes media_asset.media_info, so scope organize.read -> organize.execute - e2e e6-w4a-endpoints -> e10-w4a-endpoints (number clashed with e6-auto-recover) - trash: reusing a consumed approval / retired planId is rejected and the file stays Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
2e3c2098fd
commit
d3de2c8971
3 files changed
+10
-5
No files matched your search
@@ -10,17 +10,17 @@ import {
|
|||||||
waitFor,
|
waitFor,
|
||||||
} from "./harness.ts";
|
} from "./harness.ts";
|
||||||
|
|
||||||
// E6 W4-A 前后端集成端点:手动提交下载(与自动同流程)、候选评估去重、库存叠加补字段、
|
// E10(原编号与 e6-auto-recover 重复,W6-B 改名) W4-A 前后端集成端点:手动提交下载(与自动同流程)、候选评估去重、库存叠加补字段、
|
||||||
// 整理记录 downloadTaskId、只读资产/产物端点、偏好标签修订历史、列表带作品标题、事件 JSON 补读。
|
// 整理记录 downloadTaskId、只读资产/产物端点、偏好标签修订历史、列表带作品标题、事件 JSON 补读。
|
||||||
|
|
||||||
const hasPg = await pgAvailable();
|
const hasPg = await pgAvailable();
|
||||||
|
|
||||||
describe.skipIf(!hasPg)("E6 W4-A 集成端点", () => {
|
describe.skipIf(!hasPg)("E10 W4-A 集成端点", () => {
|
||||||
let e: E2E;
|
let e: E2E;
|
||||||
let target: Awaited<ReturnType<typeof seedMovieTarget>>;
|
let target: Awaited<ReturnType<typeof seedMovieTarget>>;
|
||||||
|
|
||||||
beforeAll(async () => {
|
beforeAll(async () => {
|
||||||
e = await createE2E("e6");
|
e = await createE2E("e10");
|
||||||
const base = await seedBase(e);
|
const base = await seedBase(e);
|
||||||
target = await seedMovieTarget(e, base.siteId);
|
target = await seedMovieTarget(e, base.siteId);
|
||||||
}, 120_000);
|
}, 120_000);
|
||||||
|
|||||||
@@ -203,6 +203,11 @@ describe.skipIf(skip)("files 删除与回收站", () => {
|
|||||||
const ok = await del({ items, dryRun: false, planId: dry.body.data.planId }, EXEC_KEY);
|
const ok = await del({ items, dryRun: false, planId: dry.body.data.planId }, EXEC_KEY);
|
||||||
expect(ok.status).toBe(200);
|
expect(ok.status).toBe(200);
|
||||||
expect(await exists(join(h.lib, "perm.txt"))).toBe(false);
|
expect(await exists(join(h.lib, "perm.txt"))).toBe(false);
|
||||||
|
// 重放:同名文件再出现,拿用过的 planId(审批已 consumed、计划已退役)再执行 → 拒绝,文件不动
|
||||||
|
await writeFile(join(h.lib, "perm.txt"), "p2");
|
||||||
|
const replay = await del({ items, dryRun: false, planId: dry.body.data.planId }, EXEC_KEY);
|
||||||
|
expect([403, 409]).toContain(replay.status);
|
||||||
|
expect(await readFile(join(h.lib, "perm.txt"), "utf8")).toBe("p2");
|
||||||
});
|
});
|
||||||
|
|
||||||
it("离线根:删除检查返回 root_unavailable,不当作已删除", async () => {
|
it("离线根:删除检查返回 root_unavailable,不当作已删除", async () => {
|
||||||
|
|||||||
@@ -1173,8 +1173,8 @@ export const Api = {
|
|||||||
probe: ep({
|
probe: ep({
|
||||||
method: "post",
|
method: "post",
|
||||||
path: "/files/probe",
|
path: "/files/probe",
|
||||||
scope: "organize.read",
|
scope: "organize.execute",
|
||||||
summary: "ffprobe 摘要(≤20 项;已登记资产写回 media_info)",
|
summary: "ffprobe 摘要(≤20 项;已登记资产写回 media_info,所以要 organize.execute)",
|
||||||
body: files.FilesProbeRequest,
|
body: files.FilesProbeRequest,
|
||||||
response: files.FilesProbeResult,
|
response: files.FilesProbeResult,
|
||||||
}),
|
}),
|
||||||
|
|||||||
Reference in new issue
Block a user