

























@@ -64,7 +64,7 @@ describe("buildSlackProgressDraftBlocks", () => {
6464});
6565});
666667-it("caps rich progress blocks to Slack's maximum while leaving caller text fallback independent", () => {
67+it("keeps newest rich progress lines when capping Slack blocks", () => {
6868const blocksWithLabel = buildSlackProgressDraftBlocks({
6969label: "Shelling...",
7070lines: Array.from({ length: 60 }, (_value, index) => progressLine(index)),
@@ -74,18 +74,26 @@ describe("buildSlackProgressDraftBlocks", () => {
7474type: "section",
7575text: { text: "*Shelling...*" },
7676});
77+expect(blocksWithLabel?.[1]).toMatchObject({
78+type: "section",
79+fields: [{ text: "🛠️ *Exec 11*" }, { text: "run 11" }],
80+});
7781expect(blocksWithLabel?.at(-1)).toMatchObject({
7882type: "section",
79-fields: [{ text: "🛠️ *Exec 48*" }, { text: "run 48" }],
83+fields: [{ text: "🛠️ *Exec 59*" }, { text: "run 59" }],
8084});
81858286const blocksWithoutLabel = buildSlackProgressDraftBlocks({
8387lines: Array.from({ length: 60 }, (_value, index) => progressLine(index)),
8488});
8589expect(blocksWithoutLabel).toHaveLength(50);
90+expect(blocksWithoutLabel?.[0]).toMatchObject({
91+type: "section",
92+fields: [{ text: "🛠️ *Exec 10*" }, { text: "run 10" }],
93+});
8694expect(blocksWithoutLabel?.at(-1)).toMatchObject({
8795type: "section",
88-fields: [{ text: "🛠️ *Exec 49*" }, { text: "run 49" }],
96+fields: [{ text: "🛠️ *Exec 59*" }, { text: "run 59" }],
8997});
9098});
9199});
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。