Files
shields/services/mastodon/mastodon-follow.tester.js
James Cahill a2641ac5e3 Add [Mastodon] service (#3508)
* add mastodon follow service

* Use nonNegativeInteger for followers_count

* Add documentation
2019-05-31 11:38:36 -05:00

41 lines
1.0 KiB
JavaScript

'use strict'
const { isMetric } = require('../test-validators')
const t = (module.exports = require('../tester').createServiceTester())
t.create('Followers - default domain')
.get('/26471.json')
.expectBadge({
label: 'follow @wilkie',
message: isMetric,
link: [
'https://mastodon.social/users/wilkie/remote_follow',
'https://mastodon.social/users/wilkie/followers',
],
})
t.create('Followers - default domain - invalid user ID format (not a number)')
.get('/a.json')
.expectBadge({
label: 'social',
message: 'invalid user id format',
})
t.create('Followers - default domain - invalid user ID (id not in use)')
.get('/0.json')
.expectBadge({
label: 'social',
message: 'not found',
})
t.create('Followers - alternate domain')
.get('/2214.json?domain=https%3A%2F%2Fmastodon.xyz')
.expectBadge({
label: 'follow @PhotonQyv',
message: isMetric,
link: [
'https://mastodon.xyz/users/PhotonQyv/remote_follow',
'https://mastodon.xyz/users/PhotonQyv/followers',
],
})