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";
|
import type { EntityContext } from "../../context";
|
||||||
|
|
||||||
describe("Trigger Validation", () => {
|
describe("Trigger Validation", () => {
|
||||||
const createMockContext = (overrides = {}): EntityContext => ({
|
const createMockContext = (overrides = {}): ParsedGitHubContext => ({
|
||||||
eventName: "issue_comment.created",
|
eventName: "issue_comment",
|
||||||
|
eventAction: "created",
|
||||||
repository: {
|
repository: {
|
||||||
owner: "test-owner",
|
owner: "test-owner",
|
||||||
repo: "test-repo",
|
repo: "test-repo",
|
||||||
|
full_name: "test-owner/test-repo",
|
||||||
},
|
},
|
||||||
actor: "testuser",
|
actor: "testuser",
|
||||||
isPR: false,
|
|
||||||
entityNumber: 42,
|
entityNumber: 42,
|
||||||
comment: {
|
isPR: false,
|
||||||
body: "Test comment",
|
runId: "test-run-id",
|
||||||
id: 12345,
|
inputs: {
|
||||||
|
triggerPhrase: "@claude",
|
||||||
|
assigneeTrigger: "",
|
||||||
|
labelTrigger: "",
|
||||||
|
prompt: "",
|
||||||
|
trackProgress: false,
|
||||||
|
},
|
||||||
|
payload: {
|
||||||
|
comment: {
|
||||||
|
body: "Test comment",
|
||||||
|
id: 12345,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
...overrides,
|
...overrides,
|
||||||
} as EntityContext);
|
} as ParsedGitHubContext);
|
||||||
|
|
||||||
describe("checkContainsTrigger", () => {
|
describe("checkContainsTrigger", () => {
|
||||||
test("should detect @claude mentions", () => {
|
test("should detect @claude mentions", () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user