aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/utils/users/login.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2017-12-28 14:29:57 +0100
committerChocobozzz <me@florianbigard.com>2017-12-28 14:29:57 +0100
commiteec63bbc0f4fdb39e56f37127b35c449f90a135f (patch)
tree2403f5efea3e281698ae4a6b550fea9dfc52e390 /server/tests/utils/users/login.ts
parentc5d31dba56d669c0df0209761c43c5a6ac7cec4a (diff)
downloadPeerTube-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.ts10
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
29async function loginAndGetAccessToken (server: Server) { 29async 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
35async function getUserAccessToken (server: Server, user: User) { 35async 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
54export { 54export {
55 login, 55 login,
56 loginAndGetAccessToken, 56 serverLogin,
57 getUserAccessToken, 57 userLogin,
58 setAccessTokensToServers 58 setAccessTokensToServers
59} 59}