JSON format modernisation and _shields_test removal (#3272)
* Modernised JSON format and removed _shields_test style * Added logoWidth and labelColor fields to JSON response * Reinstated and updated comment * Extended expectBadge to accept Joi schemas for all fields
This commit is contained in:
@@ -4,9 +4,7 @@ const { invalidJSON } = require('../response-fixtures')
|
||||
const t = (module.exports = require('../tester').createServiceTester())
|
||||
|
||||
t.create('commit status - commit in branch')
|
||||
.get(
|
||||
'/badges/shields/master/5d4ab86b1b5ddfb3c4a70a70bd19932c52603b8c.json?style=_shields_test'
|
||||
)
|
||||
.get('/badges/shields/master/5d4ab86b1b5ddfb3c4a70a70bd19932c52603b8c.json')
|
||||
.expectBadge({
|
||||
label: 'commit status',
|
||||
message: 'in master',
|
||||
@@ -16,9 +14,7 @@ t.create('commit status - commit in branch')
|
||||
t.create(
|
||||
'commit status - checked commit is identical with the newest commit in branch'
|
||||
)
|
||||
.get(
|
||||
'/badges/shields/master/5d4ab86b1b5ddfb3c4a70a70bd19932c52603b8c.json?style=_shields_test'
|
||||
)
|
||||
.get('/badges/shields/master/5d4ab86b1b5ddfb3c4a70a70bd19932c52603b8c.json')
|
||||
.intercept(nock =>
|
||||
nock('https://api.github.com')
|
||||
.get(
|
||||
@@ -33,9 +29,7 @@ t.create(
|
||||
})
|
||||
|
||||
t.create('commit status - commit not in branch')
|
||||
.get(
|
||||
'/badges/shields/master/960c5bf72d7d1539fcd453343eed3f8617427a41.json?style=_shields_test'
|
||||
)
|
||||
.get('/badges/shields/master/960c5bf72d7d1539fcd453343eed3f8617427a41.json')
|
||||
.expectBadge({
|
||||
label: 'commit status',
|
||||
message: 'commit or branch not found',
|
||||
@@ -43,9 +37,7 @@ t.create('commit status - commit not in branch')
|
||||
})
|
||||
|
||||
t.create('commit status - unknown commit id')
|
||||
.get(
|
||||
'/atom/atom/v1.27.1/7dfb45eb61a48a4ce18a0dd2e31f944ed4467ae3.json?style=_shields_test'
|
||||
)
|
||||
.get('/atom/atom/v1.27.1/7dfb45eb61a48a4ce18a0dd2e31f944ed4467ae3.json')
|
||||
.expectBadge({
|
||||
label: 'commit status',
|
||||
message: 'not in v1.27.1',
|
||||
@@ -54,7 +46,7 @@ t.create('commit status - unknown commit id')
|
||||
|
||||
t.create('commit status - unknown branch')
|
||||
.get(
|
||||
'/badges/shields/this-branch-does-not-exist/b551a3a8daf1c48dba32a3eab1edf99b10c28863.json?style=_shields_test'
|
||||
'/badges/shields/this-branch-does-not-exist/b551a3a8daf1c48dba32a3eab1edf99b10c28863.json'
|
||||
)
|
||||
.expectBadge({
|
||||
label: 'commit status',
|
||||
@@ -63,9 +55,7 @@ t.create('commit status - unknown branch')
|
||||
})
|
||||
|
||||
t.create('commit status - no common ancestor between commit and branch')
|
||||
.get(
|
||||
'/badges/shields/master/b551a3a8daf1c48dba32a3eab1edf99b10c28863.json?style=_shields_test'
|
||||
)
|
||||
.get('/badges/shields/master/b551a3a8daf1c48dba32a3eab1edf99b10c28863.json')
|
||||
.expectBadge({
|
||||
label: 'commit status',
|
||||
message: 'no common ancestor',
|
||||
@@ -75,9 +65,7 @@ t.create('commit status - no common ancestor between commit and branch')
|
||||
// Since the service is responsible for parsing its error response, this tests
|
||||
// the service, not BaseJsonService.
|
||||
t.create('commit status - 404 with invalid JSON form github')
|
||||
.get(
|
||||
'/badges/shields/master/5d4ab86b1b5ddfb3c4a70a70bd19932c52603b8c.json?style=_shields_test'
|
||||
)
|
||||
.get('/badges/shields/master/5d4ab86b1b5ddfb3c4a70a70bd19932c52603b8c.json')
|
||||
.intercept(nock =>
|
||||
nock('https://api.github.com')
|
||||
.get(
|
||||
|
||||
Reference in New Issue
Block a user