Ensure server actor AP object has avatars

This commit is contained in:
Chocobozzz
2024-02-28 14:47:39 +01:00
parent cd9b8c2cc8
commit f6fb7cd3e9
4 changed files with 31 additions and 4 deletions

View File

@@ -7,7 +7,9 @@ import {
cleanupTests,
createSingleServer,
killallServers,
makeActivityPubGetRequest,
makeGetRequest,
makeRawRequest,
PeerTubeServer,
setAccessTokensToServers
} from '@peertube/peertube-server-commands'
@@ -747,7 +749,18 @@ describe('Test config', function () {
}
})
it('Should remove instance banner', async function () {
it('Should have the avatars in the AP representation of the instance', async function () {
const res = await makeActivityPubGetRequest(server.url, '/accounts/peertube')
const object = res.body
expect(object.icon).to.have.lengthOf(4)
for (const icon of object.icon) {
await makeRawRequest({ url: icon.url, expectedStatus: HttpStatusCode.OK_200 })
}
})
it('Should remove instance avatar', async function () {
await server.config.deleteInstanceImage({ type: ActorImageType.AVATAR })
const { avatars } = await checkAndGetServerImages()
@@ -755,6 +768,13 @@ describe('Test config', function () {
await testFileExistsOrNot(server, 'avatars', basename(avatarPath), false)
})
it('Should not have the avatars anymore in the AP representation of the instance', async function () {
const res = await makeActivityPubGetRequest(server.url, '/accounts/peertube')
const object = res.body
expect(object.icon).to.not.exist
})
})
})