Fix [GitlabPipeline] not found repo service test (#5538)

* tests(GitlabPipelineStatus): fix not found service test

* docs: describe gitlab innaccessible message

Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
This commit is contained in:
Caleb Cartwright
2020-09-19 15:08:23 -05:00
committed by GitHub
parent a4baeb786a
commit fc91038652
2 changed files with 11 additions and 1 deletions

View File

@@ -32,6 +32,9 @@ const documentation = `
<p>
Your badge should be working fine now.
</p>
<p>
NB - The badge will display 'inaccessible' if the specified repo was not found on the target Gitlab instance.
</p>
`
class GitlabPipelineStatus extends BaseSvgScrapingService {

View File

@@ -20,11 +20,18 @@ t.create('Pipeline status (nonexistent branch)')
message: 'branch not found',
})
// Gitlab will redirect users to a sign-in page
// (which we ultimately see as a 503 error) in the event
// a nonexistent, or private, repository is specified.
// Given the additional complexity that would've been required to
// present users with a more traditional and friendly 'Not Found'
// error message, we will simply display inaccessible
// https://github.com/badges/shields/pull/5538
t.create('Pipeline status (nonexistent repo)')
.get('/this-repo/does-not-exist/master.json')
.expectBadge({
label: 'build',
message: 'repo not found',
message: 'inaccessible',
})
t.create('Pipeline status (custom gitlab URL)')