| 145 | } |
| 146 | |
| 147 | func TestString(t *testing.T) { |
| 148 | type testcase struct { |
| 149 | pr *PullRequest |
| 150 | cfg *config.Config |
| 151 | expect string |
| 152 | } |
| 153 | |
| 154 | cfg := &config.Config{ |
| 155 | Repo: &config.RepoConfig{ |
| 156 | RequireChecks: true, |
| 157 | RequireApproval: true, |
| 158 | }, |
| 159 | User: &config.UserConfig{ |
| 160 | StatusBitsEmojis: false, |
| 161 | }, |
| 162 | } |
| 163 | |
| 164 | pr := func(inQueue bool, commits int) *PullRequest { |
| 165 | return &PullRequest{ |
| 166 | InQueue: inQueue, |
| 167 | Commits: make([]git.Commit, commits), |
| 168 | Title: "Title", |
| 169 | MergeStatus: PullRequestMergeStatus{}, |
| 170 | } |
| 171 | } |
| 172 | |
| 173 | cfgWithShowPRLink := &config.Config{ |
| 174 | Repo: &config.RepoConfig{ |
| 175 | RequireChecks: true, |
| 176 | RequireApproval: true, |
| 177 | GitHubHost: "github.com", |
| 178 | GitHubRepoOwner: "testowner", |
| 179 | GitHubRepoName: "testrepo", |
| 180 | }, |
| 181 | User: &config.UserConfig{ |
| 182 | StatusBitsEmojis: false, |
| 183 | ShowPRLink: true, |
| 184 | }, |
| 185 | } |
| 186 | |
| 187 | cfgWithShortPRLink := &config.Config{ |
| 188 | Repo: &config.RepoConfig{ |
| 189 | RequireChecks: true, |
| 190 | RequireApproval: true, |
| 191 | GitHubHost: "github.com", |
| 192 | GitHubRepoOwner: "testowner", |
| 193 | GitHubRepoName: "testrepo", |
| 194 | }, |
| 195 | User: &config.UserConfig{ |
| 196 | StatusBitsEmojis: false, |
| 197 | ShortPRLink: true, |
| 198 | }, |
| 199 | } |
| 200 | |
| 201 | cfgWithCommitID := &config.Config{ |
| 202 | Repo: &config.RepoConfig{ |
| 203 | RequireChecks: true, |
| 204 | RequireApproval: true, |