From 8b3d94275f50c585c21caa84a351f28cfd5f242a Mon Sep 17 00:00:00 2001 From: Jeevan Joshi Date: Mon, 16 Dec 2024 13:33:56 +0530 Subject: [PATCH] test PUB monthly downloads badge --- services/pub/pub-downloads.tester.js | 38 ++++++++++++++++------------ 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/services/pub/pub-downloads.tester.js b/services/pub/pub-downloads.tester.js index 1637b4d5601a7..0f56b970acf06 100644 --- a/services/pub/pub-downloads.tester.js +++ b/services/pub/pub-downloads.tester.js @@ -1,22 +1,28 @@ -import { isMetric } from '../test-validators.js' +import { isMetricOverTimePeriod } from '../test-validators.js' import { createServiceTester } from '../tester.js' export const t = await createServiceTester() -t.create('pub downloads (valid)').get('/analysis_options.json').expectBadge({ - label: 'downloads', - message: isMetric, - color: 'blue', -}) +t.create('pub monthly downloads (valid)') + .get('/analysis_options.json') + .expectBadge({ + label: 'downloads', + message: isMetricOverTimePeriod, + color: 'blue', + }) -t.create('pub downloads (not found)').get('/analysisoptions.json').expectBadge({ - label: 'downloads', - message: 'not found', - color: 'red', -}) +t.create('pub monthly downloads (not found)') + .get('/analysisoptions.json') + .expectBadge({ + label: 'downloads', + message: 'not found', + color: 'red', + }) -t.create('pub downloads (invalid)').get('/analysis-options.json').expectBadge({ - label: 'downloads', - message: 'invalid', - color: 'lightgrey', -}) +t.create('pub monthly downloads (invalid)') + .get('/analysis-options.json') + .expectBadge({ + label: 'downloads', + message: 'invalid', + color: 'lightgrey', + })