aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/activitypub/refresher.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests/api/activitypub/refresher.ts')
-rw-r--r--server/tests/api/activitypub/refresher.ts20
1 files changed, 11 insertions, 9 deletions
diff --git a/server/tests/api/activitypub/refresher.ts b/server/tests/api/activitypub/refresher.ts
index c717f1a30..0d5452ea4 100644
--- a/server/tests/api/activitypub/refresher.ts
+++ b/server/tests/api/activitypub/refresher.ts
@@ -1,8 +1,10 @@
1/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ 1/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
2 2
3import 'mocha' 3import 'mocha'
4import { HttpStatusCode } from '@shared/core-utils'
4import { 5import {
5 cleanupTests, closeAllSequelize, 6 cleanupTests,
7 closeAllSequelize,
6 createVideoPlaylist, 8 createVideoPlaylist,
7 doubleFollow, 9 doubleFollow,
8 flushAndRunMultipleServers, 10 flushAndRunMultipleServers,
@@ -21,10 +23,8 @@ import {
21 uploadVideoAndGetId, 23 uploadVideoAndGetId,
22 wait, 24 wait,
23 waitJobs 25 waitJobs
24} from '../../../../shared/extra-utils' 26} from '@shared/extra-utils'
25import { getAccount } from '../../../../shared/extra-utils/users/accounts' 27import { VideoPlaylistPrivacy } from '@shared/models'
26import { VideoPlaylistPrivacy } from '../../../../shared/models/videos'
27import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes'
28 28
29describe('Test AP refresher', function () { 29describe('Test AP refresher', function () {
30 let servers: ServerInfo[] = [] 30 let servers: ServerInfo[] = []
@@ -116,19 +116,21 @@ describe('Test AP refresher', function () {
116 it('Should remove a deleted actor', async function () { 116 it('Should remove a deleted actor', async function () {
117 this.timeout(60000) 117 this.timeout(60000)
118 118
119 const command = servers[0].accountsCommand
120
119 await wait(10000) 121 await wait(10000)
120 122
121 // Change actor name so the remote server returns a 404 123 // Change actor name so the remote server returns a 404
122 const to = 'http://localhost:' + servers[1].port + '/accounts/user2' 124 const to = 'http://localhost:' + servers[1].port + '/accounts/user2'
123 await setActorField(servers[1].internalServerNumber, to, 'preferredUsername', 'toto') 125 await setActorField(servers[1].internalServerNumber, to, 'preferredUsername', 'toto')
124 126
125 await getAccount(servers[0].url, 'user1@localhost:' + servers[1].port) 127 await command.get({ accountName: 'user1@localhost:' + servers[1].port })
126 await getAccount(servers[0].url, 'user2@localhost:' + servers[1].port) 128 await command.get({ accountName: 'user2@localhost:' + servers[1].port })
127 129
128 await waitJobs(servers) 130 await waitJobs(servers)
129 131
130 await getAccount(servers[0].url, 'user1@localhost:' + servers[1].port, HttpStatusCode.OK_200) 132 await command.get({ accountName: 'user1@localhost:' + servers[1].port, expectedStatus: HttpStatusCode.OK_200 })
131 await getAccount(servers[0].url, 'user2@localhost:' + servers[1].port, HttpStatusCode.NOT_FOUND_404) 133 await command.get({ accountName: 'user2@localhost:' + servers[1].port, expectedStatus: HttpStatusCode.NOT_FOUND_404 })
132 }) 134 })
133 }) 135 })
134 136