This commit is contained in:
km-anthropic
2025-08-08 09:38:33 -07:00
14 changed files with 170 additions and 5 deletions

View File

@@ -67,6 +67,7 @@ describe("checkWritePermissions", () => {
branchPrefix: "claude/",
useStickyComment: false,
useCommitSigning: false,
allowedBots: "",
},
});
@@ -120,6 +121,16 @@ describe("checkWritePermissions", () => {
);
});
test("should return true for bot user", async () => {
const mockOctokit = createMockOctokit("none");
const context = createContext();
context.actor = "test-bot[bot]";
const result = await checkWritePermissions(mockOctokit, context);
expect(result).toBe(true);
});
test("should throw error when permission check fails", async () => {
const error = new Error("API error");
const mockOctokit = {