fix(slack): scope download-file to channel and thread context

This commit is contained in:
Peter Steinberger
2026-03-02 02:23:12 +00:00
parent 17bae93680
commit 40fda40aa7
6 changed files with 298 additions and 12 deletions

View File

@@ -216,6 +216,33 @@ describe("handleSlackAction", () => {
);
});
it("passes download scope (channel/thread) to downloadSlackFile", async () => {
downloadSlackFile.mockResolvedValueOnce(null);
const result = await handleSlackAction(
{
action: "downloadFile",
fileId: "F123",
to: "channel:C1",
replyTo: "123.456",
},
slackConfig(),
);
expect(downloadSlackFile).toHaveBeenCalledWith(
"F123",
expect.objectContaining({
channelId: "C1",
threadId: "123.456",
}),
);
expect(result).toEqual(
expect.objectContaining({
details: expect.objectContaining({ ok: false }),
}),
);
});
it.each([
{
name: "JSON blocks",