[Github] Handle the case when the Github deployment status returns null (#5704)
* Handle the case when the Github deployment status returns null * Integration test null latestStatus response from Github Deployments Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
This commit is contained in:
@@ -11,6 +11,7 @@ const validMessages = [
|
||||
'in progress',
|
||||
'queued',
|
||||
'pending',
|
||||
'no status yet',
|
||||
]
|
||||
const isValidMessages = Joi.equal(...validMessages).required()
|
||||
|
||||
@@ -27,3 +28,19 @@ t.create('Deployments (environment not found)')
|
||||
label: 'state',
|
||||
message: 'environment not found',
|
||||
})
|
||||
|
||||
t.create('Deployments (status not yet available)')
|
||||
.get('/badges/shields/shields-staging.json')
|
||||
.intercept(nock =>
|
||||
nock('https://api.github.com/')
|
||||
.post('/graphql')
|
||||
.reply(200, {
|
||||
data: {
|
||||
repository: { deployments: { nodes: [{ latestStatus: null }] } },
|
||||
},
|
||||
})
|
||||
)
|
||||
.expectBadge({
|
||||
label: 'state',
|
||||
message: 'no status yet',
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user