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:
@@ -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 {
|
||||
|
||||
@@ -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)')
|
||||
|
||||
Reference in New Issue
Block a user