Skip to content

Commit 38a1158

Browse files
committed
test(issues): cover empty body after invisible character filtering
1 parent e794a2d commit 38a1158

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

pkg/github/issues_test.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4169,6 +4169,17 @@ func TestAddIssueComment(t *testing.T) {
41694169
"body": "\u2068@\u2069\u2068d\u2069ependabot rebase",
41704170
},
41714171
},
4172+
{
4173+
name: "rejects comment body that is only invisible characters",
4174+
requestArgs: map[string]any{
4175+
"owner": "owner",
4176+
"repo": "repo",
4177+
"issue_number": float64(42),
4178+
"body": "\u200B\u2068\u2069",
4179+
},
4180+
expectToolError: true,
4181+
expectedToolErrMsg: "body cannot be empty after removing invisible characters",
4182+
},
41724183
{
41734184
name: "successful reaction to issue",
41744185
mockedClient: MockHTTPClientWithHandlers(map[string]http.HandlerFunc{

0 commit comments

Comments
 (0)