Initial import of streamline
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
import { expect, test } from "bun:test";
|
||||
import { checkpointBugText } from "../src/components/CheckpointBugFiling";
|
||||
|
||||
const source = { id: "5a9c7764-6f98-47c2-b3e0-f2599143d471", title: "Add to Story 草稿恢复", platform: "android", clusters: [] };
|
||||
const c = {
|
||||
id: "C03", path: ["普通快拍草稿里的 @ 贴纸不受影响"], pre: "登录任意账号", step: "1. 添加 @ 贴纸\n2. 保存草稿再打开", videos: [],
|
||||
checkpoints: [] as never[],
|
||||
};
|
||||
const p = { no: 5, expect: "重新打开后 @ 贴纸仍在、只有一个", verdict: "fail" as const, actual: "@ 贴纸往左上偏了约 40px", detail: "复现 2 次", shot: "c05.png" };
|
||||
const meta = [
|
||||
{ label: "被测提交", value: "5f856ef24f56 · fix/x" }, { label: "被测包", value: "47.6.0" }, { label: "设备", value: "Pixel 7" },
|
||||
];
|
||||
|
||||
test("首行是标题(写了期望就用期望);期望、实际、用例、截图、被测提交和来源都在;设备这类无关元信息不进", () => {
|
||||
const t = checkpointBugText(source, c, p, "贴纸应该停在保存前的位置", { meta, shotUrl: "https://cdn/x/c05.png" });
|
||||
const lines = t.split("\n");
|
||||
expect(lines[0]).toBe("【验证转单】普通快拍草稿里的 @ 贴纸不受影响 · 贴纸应该停在保存前的位置");
|
||||
expect(t).toContain("**应该是什么样**:贴纸应该停在保存前的位置");
|
||||
expect(t).toContain("**验证时实际看到**:@ 贴纸往左上偏了约 40px");
|
||||
expect(t).toContain("**细节**:复现 2 次");
|
||||
expect(t).toContain("用例 C03 · 检查点 #5");
|
||||
expect(t).toContain("操作步骤:1. 添加 @ 贴纸\n2. 保存草稿再打开");
|
||||
expect(t).toContain("检查点预期:重新打开后 @ 贴纸仍在、只有一个");
|
||||
expect(t).toContain("截图:https://cdn/x/c05.png");
|
||||
expect(t).toContain("被测提交:5f856ef24f56 · fix/x");
|
||||
expect(t).toContain("被测包:47.6.0");
|
||||
expect(t).not.toContain("Pixel 7");
|
||||
expect(t).toContain(`?task_id=${source.id}`);
|
||||
});
|
||||
|
||||
test("没写期望就用检查点预期;阻塞的检查点写清卡在哪", () => {
|
||||
const blocked = { ...c, blocked: { caseId: "C03", where: "没有互关账号", progress: "" } };
|
||||
const t = checkpointBugText(source, blocked, { ...p, verdict: "blocked" as never, actual: "", detail: "", shot: null }, " ", { meta: [], shotUrl: null });
|
||||
expect(t.split("\n")[0]).toBe("【验证转单】普通快拍草稿里的 @ 贴纸不受影响 · 重新打开后 @ 贴纸仍在、只有一个");
|
||||
expect(t).toContain("没走到 —— 卡在:没有互关账号");
|
||||
expect(t).not.toContain("截图:");
|
||||
});
|
||||
Reference in New Issue
Block a user