(t *testing.T)
| 176 | } |
| 177 | |
| 178 | func TestParseReactionConfigMap(t *testing.T) { |
| 179 | reaction, issues, pullRequests, discussions, err := parseReactionConfig(map[string]any{ |
| 180 | "type": "rocket", |
| 181 | "issues": false, |
| 182 | "pull-requests": true, |
| 183 | "discussions": false, |
| 184 | }) |
| 185 | if err != nil { |
| 186 | t.Errorf("parseReactionConfig(map) returned unexpected error: %v", err) |
| 187 | } |
| 188 | if reaction != "rocket" { |
| 189 | t.Errorf("Expected reaction type 'rocket', got %q", reaction) |
| 190 | } |
| 191 | if issues == nil || *issues { |
| 192 | t.Errorf("Expected issues target false, got %v", issues) |
| 193 | } |
| 194 | if pullRequests == nil || !*pullRequests { |
| 195 | t.Errorf("Expected pull-requests target true, got %v", pullRequests) |
| 196 | } |
| 197 | if discussions == nil || *discussions { |
| 198 | t.Errorf("Expected discussions target false, got %v", discussions) |
| 199 | } |
| 200 | } |
| 201 | |
| 202 | func TestParseReactionConfigMapAllTargetsDisabled(t *testing.T) { |
| 203 | _, _, _, _, err := parseReactionConfig(map[string]any{ |
nothing calls this directly
no test coverage detected