mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-05 19:42:24 +02:00
Refactor requests
This commit is contained in:
parent
08642a765e
commit
c0e8b12e7f
230 changed files with 948 additions and 1064 deletions
|
@ -1,14 +1,15 @@
|
|||
/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
|
||||
|
||||
import 'mocha'
|
||||
import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes'
|
||||
import {
|
||||
cleanupTests,
|
||||
createSingleServer,
|
||||
makeGetRequest,
|
||||
makePutBodyRequest,
|
||||
PeerTubeServer,
|
||||
setAccessTokensToServers
|
||||
} from '../../../../shared/extra-utils'
|
||||
import { makeGetRequest, makePutBodyRequest } from '../../../../shared/extra-utils/requests/requests'
|
||||
} from '@shared/extra-utils'
|
||||
import { HttpStatusCode } from '@shared/models'
|
||||
|
||||
describe('Test custom pages validators', function () {
|
||||
const path = '/api/v1/custom-pages/homepage/instance'
|
||||
|
@ -37,7 +38,7 @@ describe('Test custom pages validators', function () {
|
|||
url: server.url,
|
||||
path,
|
||||
fields: { content: 'super content' },
|
||||
statusCodeExpected: HttpStatusCode.UNAUTHORIZED_401
|
||||
expectedStatus: HttpStatusCode.UNAUTHORIZED_401
|
||||
})
|
||||
})
|
||||
|
||||
|
@ -47,7 +48,7 @@ describe('Test custom pages validators', function () {
|
|||
path,
|
||||
token: userAccessToken,
|
||||
fields: { content: 'super content' },
|
||||
statusCodeExpected: HttpStatusCode.FORBIDDEN_403
|
||||
expectedStatus: HttpStatusCode.FORBIDDEN_403
|
||||
})
|
||||
})
|
||||
|
||||
|
@ -57,7 +58,7 @@ describe('Test custom pages validators', function () {
|
|||
path,
|
||||
token: server.accessToken,
|
||||
fields: { content: 'super content' },
|
||||
statusCodeExpected: HttpStatusCode.NO_CONTENT_204
|
||||
expectedStatus: HttpStatusCode.NO_CONTENT_204
|
||||
})
|
||||
})
|
||||
})
|
||||
|
@ -68,7 +69,7 @@ describe('Test custom pages validators', function () {
|
|||
await makeGetRequest({
|
||||
url: server.url,
|
||||
path,
|
||||
statusCodeExpected: HttpStatusCode.OK_200
|
||||
expectedStatus: HttpStatusCode.OK_200
|
||||
})
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue