Files
shields/services/chrome-web-store/chrome-web-store-price.tester.js
chris48s 8621fe42d7 Upgrade Joi (#3505)
* upgrade joi
* find & replace ALL THE THINGS
* update related deps
2019-06-02 21:59:55 +01:00

22 lines
657 B
JavaScript

'use strict'
const Joi = require('@hapi/joi')
const t = (module.exports = require('../tester').createServiceTester())
t.create('Price')
.get('/alhjnofcnnpeaphgeakdhkebafjcpeae.json')
.expectBadge({
label: 'price',
message: Joi.string().regex(/^\$\d+(.\d{1,2})?$/),
})
t.create('Price (not found)')
.get('/invalid-name-of-addon.json')
.expectBadge({ label: 'price', message: 'not found' })
// Keep this "inaccessible" test, since this service does not use BaseService#_request.
t.create('Price (inaccessible)')
.get('/alhjnofcnnpeaphgeakdhkebafjcpeae.json')
.networkOff()
.expectBadge({ label: 'price', message: 'inaccessible' })