Skip to content

Commit 32d9948

Browse files
committed
fix: tests
1 parent f4f0b3b commit 32d9948

File tree

2 files changed

+25
-2
lines changed

2 files changed

+25
-2
lines changed

Diff for: moderation.go

+1
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,7 @@ type SendModeratorWarnChatMessageParams struct {
431431
// The ID of the broadcaster whose chat room the message will be sent to
432432
BroadcasterID string `query:"broadcaster_id"`
433433

434+
// The ID of the twitch user who requested the warning.
434435
ModeratorID string `query:"moderator_id"`
435436

436437
// The ID of the user sent the WARN message

Diff for: moderation_test.go

+24-2
Original file line numberDiff line numberDiff line change
@@ -1141,16 +1141,38 @@ func TestSendModeratorWarnMessage(t *testing.T) {
11411141
"",
11421142
},
11431143
{
1144-
http.StatusUnauthorized,
1144+
http.StatusOK,
11451145
&Options{ClientID: "my-client-id", UserAccessToken: "invalid-access-token"},
11461146
&SendModeratorWarnChatMessageParams{
11471147
BroadcasterID: "1234",
11481148
ModeratorID: "5678",
11491149
Reason: "Test warning message",
11501150
},
1151-
`{"error":"Unauthorized","status":401,"message":"Invalid OAuth token"}`,
1151+
"",
11521152
"error: user id must be specified",
11531153
},
1154+
{
1155+
http.StatusOK,
1156+
&Options{ClientID: "my-client-id", UserAccessToken: "invalid-access-token"},
1157+
&SendModeratorWarnChatMessageParams{
1158+
UserID: "1234",
1159+
ModeratorID: "5678",
1160+
Reason: "Test warning message",
1161+
},
1162+
"",
1163+
"error: broadcaster id must be specified",
1164+
},
1165+
{
1166+
http.StatusOK,
1167+
&Options{ClientID: "my-client-id", UserAccessToken: "invalid-access-token"},
1168+
&SendModeratorWarnChatMessageParams{
1169+
UserID: "1234",
1170+
BroadcasterID: "12345",
1171+
Reason: "Test warning message",
1172+
},
1173+
"",
1174+
"error: moderator id must be specified",
1175+
},
11541176
{
11551177
http.StatusUnauthorized,
11561178
&Options{ClientID: "my-client-id", UserAccessToken: "invalid-access-token"},

0 commit comments

Comments
 (0)