@@ -110,36 +110,29 @@ describe("isSilentReplyText", () => {
110110 expect ( isSilentReplyText ( "Please NO_REPLY to this" ) ) . toBe ( false ) ;
111111 } ) ;
112112
113- it ( "returns true for token with stray leading punctuation (#98166)" , ( ) => {
114- expect ( isSilentReplyText ( ".NO_REPLY" ) ) . toBe ( true ) ;
115- expect ( isSilentReplyText ( "*NO_REPLY" ) ) . toBe ( true ) ;
116- expect ( isSilentReplyText ( "...NO_REPLY" ) ) . toBe ( true ) ;
117- } ) ;
118-
119- it ( "returns true for token with stray trailing punctuation (#98166)" , ( ) => {
120- expect ( isSilentReplyText ( "NO_REPLY." ) ) . toBe ( true ) ;
121- expect ( isSilentReplyText ( "NO_REPLY*" ) ) . toBe ( true ) ;
122- expect ( isSilentReplyText ( "NO_REPLY..." ) ) . toBe ( true ) ;
123- } ) ;
124-
125- it ( "returns true for token with punctuation on both sides (#98166)" , ( ) => {
126- expect ( isSilentReplyText ( "*NO_REPLY*" ) ) . toBe ( true ) ;
127- expect ( isSilentReplyText ( "\"NO_REPLY\"" ) ) . toBe ( true ) ;
128- expect ( isSilentReplyText ( ".NO_REPLY." ) ) . toBe ( true ) ;
129- } ) ;
130-
131- it ( "still returns false for substantive text with stray punctuation before token" , ( ) => {
132- // "the sentinel is NO_REPLY, fyi" should remain false
133- expect ( isSilentReplyText ( "the sentinel is NO_REPLY, fyi" ) ) . toBe ( false ) ;
134- } ) ;
135-
136- it ( "returns true for punctuation with surrounding whitespace (#98166)" , ( ) => {
137- expect ( isSilentReplyText ( " .NO_REPLY" ) ) . toBe ( true ) ;
138- expect ( isSilentReplyText ( ".NO_REPLY " ) ) . toBe ( true ) ;
139- expect ( isSilentReplyText ( " .NO_REPLY " ) ) . toBe ( true ) ;
140- expect ( isSilentReplyText ( " NO_REPLY. " ) ) . toBe ( true ) ;
141- expect ( isSilentReplyText ( " *NO_REPLY* " ) ) . toBe ( true ) ;
142- } ) ;
113+ it . each ( [
114+ ".NO_REPLY" ,
115+ "*NO_REPLY" ,
116+ "...NO_REPLY" ,
117+ "NO_REPLY." ,
118+ "NO_REPLY*" ,
119+ "NO_REPLY..." ,
120+ "*NO_REPLY*" ,
121+ '"NO_REPLY"' ,
122+ ".NO_REPLY." ,
123+ " .NO_REPLY " ,
124+ " NO_REPLY. " ,
125+ " *NO_REPLY* " ,
126+ ] ) ( "returns true for punctuation-wrapped token-only text: %j (#98166)" , ( text ) => {
127+ expect ( isSilentReplyText ( text ) ) . toBe ( true ) ;
128+ } ) ;
129+
130+ it . each ( [ "the sentinel is NO_REPLY, fyi" , "💬NO_REPLY" , "NO_REPLY👍" ] ) (
131+ "keeps substantive punctuation or symbols: %j" ,
132+ ( text ) => {
133+ expect ( isSilentReplyText ( text ) ) . toBe ( false ) ;
134+ } ,
135+ ) ;
143136
144137 it ( "preserves exact custom-token matches with punctuation-edged tokens" , ( ) => {
145138 // Custom tokens whose first/last character is punctuation must still match
0 commit comments