diff options
author | Chocobozzz <me@florianbigard.com> | 2017-12-28 14:29:57 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2017-12-28 14:29:57 +0100 |
commit | eec63bbc0f4fdb39e56f37127b35c449f90a135f (patch) | |
tree | 2403f5efea3e281698ae4a6b550fea9dfc52e390 /server/tests/utils/users/login.ts | |
parent | c5d31dba56d669c0df0209761c43c5a6ac7cec4a (diff) | |
download | PeerTube-eec63bbc0f4fdb39e56f37127b35c449f90a135f.tar.gz PeerTube-eec63bbc0f4fdb39e56f37127b35c449f90a135f.tar.zst PeerTube-eec63bbc0f4fdb39e56f37127b35c449f90a135f.zip |
Improve check follow params tests
Diffstat (limited to 'server/tests/utils/users/login.ts')
-rw-r--r-- | server/tests/utils/users/login.ts | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/server/tests/utils/users/login.ts b/server/tests/utils/users/login.ts index 855c4828d..04444e2f1 100644 --- a/server/tests/utils/users/login.ts +++ b/server/tests/utils/users/login.ts | |||
@@ -26,13 +26,13 @@ function login (url: string, client: Client, user: User, expectedStatus = 200) { | |||
26 | .expect(expectedStatus) | 26 | .expect(expectedStatus) |
27 | } | 27 | } |
28 | 28 | ||
29 | async function loginAndGetAccessToken (server: Server) { | 29 | async function serverLogin (server: Server) { |
30 | const res = await login(server.url, server.client, server.user, 200) | 30 | const res = await login(server.url, server.client, server.user, 200) |
31 | 31 | ||
32 | return res.body.access_token as string | 32 | return res.body.access_token as string |
33 | } | 33 | } |
34 | 34 | ||
35 | async function getUserAccessToken (server: Server, user: User) { | 35 | async function userLogin (server: Server, user: User) { |
36 | const res = await login(server.url, server.client, user, 200) | 36 | const res = await login(server.url, server.client, user, 200) |
37 | 37 | ||
38 | return res.body.access_token as string | 38 | return res.body.access_token as string |
@@ -42,7 +42,7 @@ function setAccessTokensToServers (servers: ServerInfo[]) { | |||
42 | const tasks: Promise<any>[] = [] | 42 | const tasks: Promise<any>[] = [] |
43 | 43 | ||
44 | for (const server of servers) { | 44 | for (const server of servers) { |
45 | const p = loginAndGetAccessToken(server).then(t => server.accessToken = t) | 45 | const p = serverLogin(server).then(t => server.accessToken = t) |
46 | tasks.push(p) | 46 | tasks.push(p) |
47 | } | 47 | } |
48 | 48 | ||
@@ -53,7 +53,7 @@ function setAccessTokensToServers (servers: ServerInfo[]) { | |||
53 | 53 | ||
54 | export { | 54 | export { |
55 | login, | 55 | login, |
56 | loginAndGetAccessToken, | 56 | serverLogin, |
57 | getUserAccessToken, | 57 | userLogin, |
58 | setAccessTokensToServers | 58 | setAccessTokensToServers |
59 | } | 59 | } |