Files
shields/services/wordpress/wordpress-rating.tester.js
2019-05-07 11:39:00 -04:00

67 lines
1.4 KiB
JavaScript

'use strict'
const { ServiceTester } = require('../tester')
const { isStarRating } = require('../test-validators')
const t = new ServiceTester({
id: 'wordpress',
title: 'WordPress Rating Tests',
})
module.exports = t
t.create('Plugin Rating - Stars')
.get('/plugin/stars/akismet.json')
.expectBadge({
label: 'rating',
message: isStarRating,
})
t.create('Plugin Rating - Stars | Not Found')
.get('/plugin/stars/100.json')
.expectBadge({
label: 'rating',
message: 'not found',
})
t.create('Plugin Rating - Stars (Alias)')
.get('/plugin/r/akismet.json')
.expectBadge({
label: 'rating',
message: isStarRating,
})
t.create('Plugin Rating - Stars (Alias) | Not Found')
.get('/plugin/r/100.json')
.expectBadge({
label: 'rating',
message: 'not found',
})
t.create('Theme Rating - Stars')
.get('/theme/stars/twentyseventeen.json')
.expectBadge({
label: 'rating',
message: isStarRating,
})
t.create('Theme Rating - Stars | Not Found')
.get('/theme/stars/100.json')
.expectBadge({
label: 'rating',
message: 'not found',
})
t.create('Theme Rating - Stars (Alias)')
.get('/theme/r/twentyseventeen.json')
.expectBadge({
label: 'rating',
message: isStarRating,
})
t.create('Theme Rating - Stars (Alias) | Not Found')
.get('/theme/r/100.json')
.expectBadge({
label: 'rating',
message: 'not found',
})