* add mastodon follow service * Use nonNegativeInteger for followers_count * Add documentation
41 lines
1.0 KiB
JavaScript
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',
|
|
],
|
|
})
|