Files
shields/services/pub/pub-popularity.tester.js
Jeevan Chandra Joshi 3e2c9b20e0 add [PUB] popularity badge (#7920)
* add PUB popularity badge

* update PUB popularity badge

* update PUB popularity badge

Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2022-05-08 13:39:34 +00:00

24 lines
610 B
JavaScript

import { isIntegerPercentage } from '../test-validators.js'
import { createServiceTester } from '../tester.js'
export const t = await createServiceTester()
t.create('pub popularity (valid)').get('/analysis_options.json').expectBadge({
label: 'popularity',
message: isIntegerPercentage,
})
t.create('pub popularity (not found)')
.get('/analysisoptions.json')
.expectBadge({
label: 'popularity',
message: 'not found',
color: 'red',
})
t.create('pub popularity (invalid)').get('/analysis-options.json').expectBadge({
label: 'popularity',
message: 'invalid',
color: 'lightgrey',
})