File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed
src/github/validation/__tests__ Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff 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 ) ;
You can’t perform that action at this time.
0 commit comments