mirror of
https://github.com/anthropics/claude-code-action.git
synced 2026-01-22 22:44:13 +08:00
Update src/github/validation/__tests__/trigger.test.ts
Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
This commit is contained in:
@@ -3,21 +3,33 @@ import { checkContainsTrigger } from "../trigger";
|
||||
import type { EntityContext } from "../../context";
|
||||
|
||||
describe("Trigger Validation", () => {
|
||||
const createMockContext = (overrides = {}): EntityContext => ({
|
||||
eventName: "issue_comment.created",
|
||||
const createMockContext = (overrides = {}): ParsedGitHubContext => ({
|
||||
eventName: "issue_comment",
|
||||
eventAction: "created",
|
||||
repository: {
|
||||
owner: "test-owner",
|
||||
repo: "test-repo",
|
||||
full_name: "test-owner/test-repo",
|
||||
},
|
||||
actor: "testuser",
|
||||
isPR: false,
|
||||
entityNumber: 42,
|
||||
isPR: false,
|
||||
runId: "test-run-id",
|
||||
inputs: {
|
||||
triggerPhrase: "@claude",
|
||||
assigneeTrigger: "",
|
||||
labelTrigger: "",
|
||||
prompt: "",
|
||||
trackProgress: false,
|
||||
},
|
||||
payload: {
|
||||
comment: {
|
||||
body: "Test comment",
|
||||
id: 12345,
|
||||
},
|
||||
},
|
||||
...overrides,
|
||||
} as EntityContext);
|
||||
} as ParsedGitHubContext);
|
||||
|
||||
describe("checkContainsTrigger", () => {
|
||||
test("should detect @claude mentions", () => {
|
||||
|
||||
Reference in New Issue
Block a user