Files
shields/services/wordpress/wordpress-rating.tester.js
Paul Melnikow 4bd16f93e8 Sort imports and requires (#3056)
This will definitely save time, and ensure more uniformity.

It moves the `createServiceTester()` calls to a different place from where I'd like them, though I'm happy to have them checked by the linter.

Closes #2701
2019-02-21 22:14:40 -05:00

76 lines
1.5 KiB
JavaScript

'use strict'
const Joi = require('joi')
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')
.expectJSONTypes(
Joi.object().keys({
name: 'rating',
value: isStarRating,
})
)
t.create('Plugin Rating - Stars | Not Found')
.get('/plugin/stars/100.json')
.expectJSON({
name: 'rating',
value: 'not found',
})
t.create('Plugin Rating - Stars (Alias)')
.get('/plugin/r/akismet.json')
.expectJSONTypes(
Joi.object().keys({
name: 'rating',
value: isStarRating,
})
)
t.create('Plugin Rating - Stars (Alias) | Not Found')
.get('/plugin/r/100.json')
.expectJSON({
name: 'rating',
value: 'not found',
})
t.create('Theme Rating - Stars')
.get('/theme/stars/twentyseventeen.json')
.expectJSONTypes(
Joi.object().keys({
name: 'rating',
value: isStarRating,
})
)
t.create('Theme Rating - Stars | Not Found')
.get('/theme/stars/100.json')
.expectJSON({
name: 'rating',
value: 'not found',
})
t.create('Theme Rating - Stars (Alias)')
.get('/theme/r/twentyseventeen.json')
.expectJSONTypes(
Joi.object().keys({
name: 'rating',
value: isStarRating,
})
)
t.create('Theme Rating - Stars (Alias) | Not Found')
.get('/theme/r/100.json')
.expectJSON({
name: 'rating',
value: 'not found',
})