Merge pull request #68 from cloudflare/sven/stub-blocks

stub account blocks API
pull/70/head
Sven Sauleau 2023-01-11 09:17:06 +00:00 zatwierdzone przez GitHub
commit 86e8ea218c
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
2 zmienionych plików z 18 dodań i 0 usunięć

Wyświetl plik

@ -4,6 +4,7 @@ import * as v2_instance from 'wildebeest/functions/api/v2/instance'
import * as apps from 'wildebeest/functions/api/v1/apps'
import * as custom_emojis from 'wildebeest/functions/api/v1/custom_emojis'
import * as mutes from 'wildebeest/functions/api/v1/mutes'
import * as blocks from 'wildebeest/functions/api/v1/blocks'
import { makeDB, assertCORS, assertJSON, assertCache, createTestClient } from './utils'
import { createPerson } from 'wildebeest/backend/src/activitypub/actors'
import { createSubscription } from '../src/mastodon/subscription'
@ -240,4 +241,13 @@ describe('Mastodon APIs', () => {
const data = await res.json<any>()
assert.equal(data.length, 0)
})
test('blocks returns an empty array', async () => {
const res = await blocks.onRequest()
assert.equal(res.status, 200)
assertJSON(res)
const data = await res.json<any>()
assert.equal(data.length, 0)
})
})

Wyświetl plik

@ -0,0 +1,8 @@
const headers = {
'content-type': 'application/json; charset=utf-8',
}
export const onRequest = async () => {
const out: Array<any> = []
return new Response(JSON.stringify(out), { headers })
}