aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/users/users.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-07-09 15:37:43 +0200
committerChocobozzz <me@florianbigard.com>2021-07-20 15:27:18 +0200
commit9293139fde7091e9badcafa9b570b83cea9a10ad (patch)
tree9728412f02af4aa59d2c016db47624251e8f6be6 /server/tests/api/users/users.ts
parent078f17e6d90376050f43ce639e88e11869b49ee7 (diff)
downloadPeerTube-9293139fde7091e9badcafa9b570b83cea9a10ad.tar.gz
PeerTube-9293139fde7091e9badcafa9b570b83cea9a10ad.tar.zst
PeerTube-9293139fde7091e9badcafa9b570b83cea9a10ad.zip
Introduce sql command
Diffstat (limited to 'server/tests/api/users/users.ts')
-rw-r--r--server/tests/api/users/users.ts13
1 files changed, 5 insertions, 8 deletions
diff --git a/server/tests/api/users/users.ts b/server/tests/api/users/users.ts
index 4d255f340..69a8dba34 100644
--- a/server/tests/api/users/users.ts
+++ b/server/tests/api/users/users.ts
@@ -6,7 +6,6 @@ import { HttpStatusCode } from '@shared/core-utils'
6import { 6import {
7 blockUser, 7 blockUser,
8 cleanupTests, 8 cleanupTests,
9 closeAllSequelize,
10 createUser, 9 createUser,
11 deleteMe, 10 deleteMe,
12 flushAndRunServer, 11 flushAndRunServer,
@@ -30,7 +29,6 @@ import {
30 reRunServer, 29 reRunServer,
31 ServerInfo, 30 ServerInfo,
32 setAccessTokensToServers, 31 setAccessTokensToServers,
33 setTokenField,
34 testImage, 32 testImage,
35 unblockUser, 33 unblockUser,
36 updateMyAvatar, 34 updateMyAvatar,
@@ -264,10 +262,10 @@ describe('Test users', function () {
264 it('Should have an expired access token', async function () { 262 it('Should have an expired access token', async function () {
265 this.timeout(15000) 263 this.timeout(15000)
266 264
267 await setTokenField(server.internalServerNumber, server.accessToken, 'accessTokenExpiresAt', new Date().toISOString()) 265 await server.sqlCommand.setTokenField(server.accessToken, 'accessTokenExpiresAt', new Date().toISOString())
268 await setTokenField(server.internalServerNumber, server.accessToken, 'refreshTokenExpiresAt', new Date().toISOString()) 266 await server.sqlCommand.setTokenField(server.accessToken, 'refreshTokenExpiresAt', new Date().toISOString())
269 267
270 killallServers([ server ]) 268 await killallServers([ server ])
271 await reRunServer(server) 269 await reRunServer(server)
272 270
273 await getMyUserInformation(server.url, server.accessToken, 401) 271 await getMyUserInformation(server.url, server.accessToken, 401)
@@ -281,9 +279,9 @@ describe('Test users', function () {
281 this.timeout(15000) 279 this.timeout(15000)
282 280
283 const futureDate = new Date(new Date().getTime() + 1000 * 60).toISOString() 281 const futureDate = new Date(new Date().getTime() + 1000 * 60).toISOString()
284 await setTokenField(server.internalServerNumber, server.accessToken, 'refreshTokenExpiresAt', futureDate) 282 await server.sqlCommand.setTokenField(server.accessToken, 'refreshTokenExpiresAt', futureDate)
285 283
286 killallServers([ server ]) 284 await killallServers([ server ])
287 await reRunServer(server) 285 await reRunServer(server)
288 286
289 const res = await refreshToken(server, server.refreshToken) 287 const res = await refreshToken(server, server.refreshToken)
@@ -1013,7 +1011,6 @@ describe('Test users', function () {
1013 }) 1011 })
1014 1012
1015 after(async function () { 1013 after(async function () {
1016 await closeAllSequelize([ server ])
1017 await cleanupTests([ server ]) 1014 await cleanupTests([ server ])
1018 }) 1015 })
1019}) 1016})