





























@@ -558,18 +558,18 @@ describe("resolveSlackMedia", () => {
558558559559const result = await resolveSlackMedia({
560560files: [
561-{ url_private: "https://files.slack.com/a.jpg", name: "a.jpg" },
562-{ url_private: "https://files.slack.com/b.png", name: "b.png" },
561+{ id: "FA", url_private: "https://files.slack.com/a.jpg", name: "a.jpg" },
562+{ id: "FB", url_private: "https://files.slack.com/b.png", name: "b.png" },
563563],
564564token: "xoxb-test-token",
565565maxBytes: 1024 * 1024,
566566});
567567568568expect(result).toHaveLength(2);
569569expect(result![0].path).toBe("/tmp/a.jpg");
570-expect(result![0].placeholder).toBe("[Slack file: a.jpg]");
570+expect(result![0].placeholder).toBe("[Slack file: a.jpg (fileId: FA)]");
571571expect(result![1].path).toBe("/tmp/b.png");
572-expect(result![1].placeholder).toBe("[Slack file: b.png]");
572+expect(result![1].placeholder).toBe("[Slack file: b.png (fileId: FB)]");
573573});
574574575575it("caps downloads to 8 files for large multi-attachment messages", async () => {
@@ -867,7 +867,7 @@ describe("resolveSlackThreadHistory", () => {
867867it("includes file-only messages and drops empty-only entries", async () => {
868868const replies = vi.fn().mockResolvedValueOnce({
869869messages: [
870-{ text: " ", ts: "1.000", files: [{ name: "screenshot.png" }] },
870+{ text: " ", ts: "1.000", files: [{ id: "FSCREEN", name: "screenshot.png" }] },
871871{ text: " ", ts: "2.000" },
872872{ text: "hello", ts: "3.000", user: "U1" },
873873],
@@ -885,7 +885,7 @@ describe("resolveSlackThreadHistory", () => {
885885});
886886887887expect(result).toHaveLength(2);
888-expect(result[0]?.text).toBe("[attached: screenshot.png]");
888+expect(result[0]?.text).toBe("[attached: screenshot.png (fileId: FSCREEN)]");
889889expect(result[1]?.text).toBe("hello");
890890});
891891@@ -982,7 +982,7 @@ describe("resolveSlackThreadStarter", () => {
982982text: " ",
983983user: "U1",
984984ts: "1.000",
985-files: [{ name: "root.png", mimetype: "image/png" }],
985+files: [{ id: "FROOT", name: "root.png", mimetype: "image/png" }],
986986},
987987],
988988});
@@ -997,11 +997,11 @@ describe("resolveSlackThreadStarter", () => {
997997});
998998999999expect(result).toEqual({
1000-text: "[attached: root.png]",
1000+text: "[attached: root.png (fileId: FROOT)]",
10011001userId: "U1",
10021002botId: undefined,
10031003ts: "1.000",
1004-files: [{ name: "root.png", mimetype: "image/png" }],
1004+files: [{ id: "FROOT", name: "root.png", mimetype: "image/png" }],
10051005});
10061006expect(vi.mocked(logVerbose)).not.toHaveBeenCalled();
10071007});
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。