aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-05-07 08:59:59 +0200
committerChocobozzz <me@florianbigard.com>2021-05-07 09:00:09 +0200
commita66c2e3252d6cca8958959966f42494ded564023 (patch)
tree79e32e2255c7787cfbd127581a4b162552068d66 /server/tests
parent64df4b65aee56784f8edad917c44b24453bf4658 (diff)
downloadPeerTube-a66c2e3252d6cca8958959966f42494ded564023.tar.gz
PeerTube-a66c2e3252d6cca8958959966f42494ded564023.tar.zst
PeerTube-a66c2e3252d6cca8958959966f42494ded564023.zip
Fix remote actor creation date
Diffstat (limited to 'server/tests')
-rw-r--r--server/tests/api/users/users-multiple-servers.ts28
1 files changed, 17 insertions, 11 deletions
diff --git a/server/tests/api/users/users-multiple-servers.ts b/server/tests/api/users/users-multiple-servers.ts
index dcd03879b..f60c66e4b 100644
--- a/server/tests/api/users/users-multiple-servers.ts
+++ b/server/tests/api/users/users-multiple-servers.ts
@@ -130,26 +130,32 @@ describe('Test users with multiple servers', function () {
130 }) 130 })
131 131
132 it('Should have updated my profile on other servers too', async function () { 132 it('Should have updated my profile on other servers too', async function () {
133 let createdAt: string | Date
134
133 for (const server of servers) { 135 for (const server of servers) {
134 const resAccounts = await getAccountsList(server.url, '-createdAt') 136 const resAccounts = await getAccountsList(server.url, '-createdAt')
135 137
136 const rootServer1List = resAccounts.body.data.find(a => a.name === 'root' && a.host === 'localhost:' + servers[0].port) as Account 138 const resList = resAccounts.body.data.find(a => a.name === 'root' && a.host === 'localhost:' + servers[0].port) as Account
137 expect(rootServer1List).not.to.be.undefined 139 expect(resList).not.to.be.undefined
140
141 const resAccount = await getAccount(server.url, resList.name + '@' + resList.host)
142 const account = resAccount.body as Account
143
144 if (!createdAt) createdAt = account.createdAt
138 145
139 const resAccount = await getAccount(server.url, rootServer1List.name + '@' + rootServer1List.host) 146 expect(account.name).to.equal('root')
140 const rootServer1Get = resAccount.body as Account 147 expect(account.host).to.equal('localhost:' + servers[0].port)
141 expect(rootServer1Get.name).to.equal('root') 148 expect(account.displayName).to.equal('my super display name')
142 expect(rootServer1Get.host).to.equal('localhost:' + servers[0].port) 149 expect(account.description).to.equal('my super description updated')
143 expect(rootServer1Get.displayName).to.equal('my super display name') 150 expect(createdAt).to.equal(account.createdAt)
144 expect(rootServer1Get.description).to.equal('my super description updated')
145 151
146 if (server.serverNumber === 1) { 152 if (server.serverNumber === 1) {
147 expect(rootServer1Get.userId).to.be.a('number') 153 expect(account.userId).to.be.a('number')
148 } else { 154 } else {
149 expect(rootServer1Get.userId).to.be.undefined 155 expect(account.userId).to.be.undefined
150 } 156 }
151 157
152 await testImage(server.url, 'avatar2-resized', rootServer1Get.avatar.path, '.png') 158 await testImage(server.url, 'avatar2-resized', account.avatar.path, '.png')
153 } 159 }
154 }) 160 })
155 161