Files
shields/services/pub/pub-downloads.tester.js
Jeevan Joshi 0cbc1319ce add [PUB] downloads badge (#10745)
* add PUB downloads badge

* test PUB downloads badge

* add PUB monthly downloads badge

* test PUB monthly downloads badge

* revert color override
2024-12-23 09:47:17 +00:00

29 lines
680 B
JavaScript

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