diff options
Diffstat (limited to 'server/tests/api/users/users-multiple-servers.ts')
-rw-r--r-- | server/tests/api/users/users-multiple-servers.ts | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/server/tests/api/users/users-multiple-servers.ts b/server/tests/api/users/users-multiple-servers.ts index 3c4eaff14..bb458f7a5 100644 --- a/server/tests/api/users/users-multiple-servers.ts +++ b/server/tests/api/users/users-multiple-servers.ts | |||
@@ -3,7 +3,10 @@ | |||
3 | import * as chai from 'chai' | 3 | import * as chai from 'chai' |
4 | import 'mocha' | 4 | import 'mocha' |
5 | import { Account } from '../../../../shared/models/actors' | 5 | import { Account } from '../../../../shared/models/actors' |
6 | import { checkVideoFilesWereRemoved, createUser, doubleFollow, flushAndRunMultipleServers, removeUser, userLogin, wait } from '../../utils' | 6 | import { |
7 | checkVideoFilesWereRemoved, createUser, doubleFollow, flushAndRunMultipleServers, removeUser, updateMyUser, userLogin, | ||
8 | wait | ||
9 | } from '../../utils' | ||
7 | import { flushTests, getMyUserInformation, killallServers, ServerInfo, testImage, updateMyAvatar, uploadVideo } from '../../utils/index' | 10 | import { flushTests, getMyUserInformation, killallServers, ServerInfo, testImage, updateMyAvatar, uploadVideo } from '../../utils/index' |
8 | import { checkActorFilesWereRemoved, getAccount, getAccountsList } from '../../utils/users/accounts' | 11 | import { checkActorFilesWereRemoved, getAccount, getAccountsList } from '../../utils/users/accounts' |
9 | import { setAccessTokensToServers } from '../../utils/users/login' | 12 | import { setAccessTokensToServers } from '../../utils/users/login' |
@@ -51,6 +54,22 @@ describe('Test users with multiple servers', function () { | |||
51 | await wait(5000) | 54 | await wait(5000) |
52 | }) | 55 | }) |
53 | 56 | ||
57 | it('Should be able to update my description', async function () { | ||
58 | this.timeout(10000) | ||
59 | |||
60 | await updateMyUser({ | ||
61 | url: servers[0].url, | ||
62 | accessToken: servers[0].accessToken, | ||
63 | description: 'my super description updated' | ||
64 | }) | ||
65 | |||
66 | const res = await getMyUserInformation(servers[0].url, servers[0].accessToken) | ||
67 | user = res.body | ||
68 | expect(user.account.description).to.equal('my super description updated') | ||
69 | |||
70 | await wait(5000) | ||
71 | }) | ||
72 | |||
54 | it('Should be able to update my avatar', async function () { | 73 | it('Should be able to update my avatar', async function () { |
55 | this.timeout(10000) | 74 | this.timeout(10000) |
56 | 75 | ||
@@ -70,7 +89,7 @@ describe('Test users with multiple servers', function () { | |||
70 | await wait(5000) | 89 | await wait(5000) |
71 | }) | 90 | }) |
72 | 91 | ||
73 | it('Should have updated my avatar on other servers too', async function () { | 92 | it('Should have updated my avatar and my description on other servers too', async function () { |
74 | for (const server of servers) { | 93 | for (const server of servers) { |
75 | const resAccounts = await getAccountsList(server.url, '-createdAt') | 94 | const resAccounts = await getAccountsList(server.url, '-createdAt') |
76 | 95 | ||
@@ -81,6 +100,7 @@ describe('Test users with multiple servers', function () { | |||
81 | const rootServer1Get = resAccount.body as Account | 100 | const rootServer1Get = resAccount.body as Account |
82 | expect(rootServer1Get.name).to.equal('root') | 101 | expect(rootServer1Get.name).to.equal('root') |
83 | expect(rootServer1Get.host).to.equal('localhost:9001') | 102 | expect(rootServer1Get.host).to.equal('localhost:9001') |
103 | expect(rootServer1Get.description).to.equal('my super description updated') | ||
84 | 104 | ||
85 | await testImage(server.url, 'avatar2-resized', rootServer1Get.avatar.path, '.png') | 105 | await testImage(server.url, 'avatar2-resized', rootServer1Get.avatar.path, '.png') |
86 | } | 106 | } |