Skip to content

Commit 7dff9f0

Browse files
Update src/github/validation/__tests__/trigger.test.ts
Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
1 parent f6b1490 commit 7dff9f0

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

src/github/validation/__tests__/trigger.test.ts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,21 @@ describe("Trigger Validation", () => {
8181
expect(result).toBe(true);
8282
});
8383

84+
test("should handle null/undefined comment body", () => {
85+
const contextNull = createMockContext({
86+
payload: { comment: { body: null } },
87+
});
88+
const contextUndefined = createMockContext({
89+
payload: { comment: { body: undefined } },
90+
});
91+
92+
expect(checkContainsTrigger(contextNull)).toBe(false);
93+
expect(checkContainsTrigger(contextUndefined)).toBe(false);
94+
});
95+
8496
test("should handle empty comment body", () => {
85-
// Subtle issue 5: Not checking null vs undefined
8697
const context = createMockContext({
87-
comment: { body: "" },
98+
payload: { comment: { body: "" } },
8899
});
89100

90101
const result = checkContainsTrigger(context);

0 commit comments

Comments
 (0)