-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
88410a9
commit a2a93ae
Showing
1 changed file
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
'use strict'; | ||
|
||
const Joi = require('joi'); | ||
const ServiceTester = require('../service-tester'); | ||
|
||
const t = new ServiceTester({ id: 'static-badge', title: 'Static Badge', pathPrefix: '/badge' }); | ||
module.exports = t; | ||
|
||
|
||
// version endpoint | ||
|
||
t.create('Shields colorscheme color') | ||
.get('/label-message-blue.json?style=_shields_test') | ||
.expectJSON({name: 'label', value: 'message', colorB: '#007ec6'}); | ||
|
||
t.create('CSS named color') | ||
.get('/label-message-whitesmoke.json?style=_shields_test') | ||
.expectJSON({name: 'label', value: 'message', colorB: 'whitesmoke'}); | ||
|
||
t.create('RGB color') | ||
.get('/label-message-rgb(123,123,123).json?style=_shields_test') | ||
.expectJSON({name: 'label', value: 'message', colorB: 'rgb(123,123,123)'}); | ||
|
||
t.create('Not a valid color') | ||
.get('/label-message-notacolor.json?style=_shields_test') | ||
.expectJSON({name: 'label', value: 'message', colorB: '#e05d44'}); | ||
|
||
t.create('Missing message') | ||
.get('/label--blue.json?style=_shields_test') | ||
.expectJSON({name: 'label', value: 'n/a', colorB: '#007ec6'}); | ||
|
||
t.create('Missing label') | ||
.get('/-message-blue.json?style=_shields_test') | ||
.expectJSON({name: 'unknown', value: 'message', colorB: '#007ec6'}); | ||
|
||
t.create('Override colorB') | ||
.get('/label-message-blue.json?style=_shields_test&colorB=yellow') | ||
.expectJSON({name: 'label', value: 'message', colorB: '#dfb317'}); | ||
|
||
t.create('Override label') | ||
.get('/label-message-blue.json?style=_shields_test&label=mylabel') | ||
.expectJSON({name: 'mylabel', value: 'message', colorB: '#007ec6'}); |