(t *testing.T)
| 132 | } |
| 133 | |
| 134 | func TestIssueDelete_cancel(t *testing.T) { |
| 135 | httpRegistry := &httpmock.Registry{} |
| 136 | defer httpRegistry.Verify(t) |
| 137 | |
| 138 | httpRegistry.Register( |
| 139 | httpmock.GraphQL(`query IssueByNumber\b`), |
| 140 | httpmock.StringResponse(` |
| 141 | { "data": { "repository": { |
| 142 | "hasIssuesEnabled": true, |
| 143 | "issue": { "id": "THE-ID", "number": 13, "title": "The title of the issue"} |
| 144 | } } }`), |
| 145 | ) |
| 146 | |
| 147 | pm := prompter.NewMockPrompter(t) |
| 148 | pm.RegisterConfirmDeletion("13", func(_ string) error { |
| 149 | return errors.New("You entered 14") |
| 150 | }) |
| 151 | |
| 152 | _, err := runCommand(httpRegistry, pm, true, "13") |
| 153 | if err == nil { |
| 154 | t.Fatalf("expected error") |
| 155 | } |
| 156 | if err.Error() != "You entered 14" { |
| 157 | t.Fatalf("got unexpected error '%s'", err) |
| 158 | } |
| 159 | } |
| 160 | |
| 161 | func TestIssueDelete_doesNotExist(t *testing.T) { |
| 162 | httpRegistry := &httpmock.Registry{} |
nothing calls this directly
no test coverage detected