diff options
author | Chocobozzz <me@florianbigard.com> | 2021-05-27 16:12:41 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-05-27 16:12:41 +0200 |
commit | 8f608a4cb22ab232cfab20665050764b38bac9c7 (patch) | |
tree | 6a6785aae79bf5939ad7b7a50a1bd8031268d2b4 /server/tests/api/users | |
parent | 030ccfce59a8cb8f2fee6ea8dd363ba635c5c5c2 (diff) | |
parent | c215e627b575d2c4085ccb222f4ca8d0237b7552 (diff) | |
download | PeerTube-8f608a4cb22ab232cfab20665050764b38bac9c7.tar.gz PeerTube-8f608a4cb22ab232cfab20665050764b38bac9c7.tar.zst PeerTube-8f608a4cb22ab232cfab20665050764b38bac9c7.zip |
Merge branch 'develop' into shorter-URLs-channels-accounts
Diffstat (limited to 'server/tests/api/users')
-rw-r--r-- | server/tests/api/users/users-multiple-servers.ts | 28 |
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 | ||