/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
-import 'mocha'
import {
cleanupTests,
createSingleServer,
await makePostBodyRequest({
url: server.url,
path,
- fields: { uri: 'user1_channel@localhost:' + server.port },
+ fields: { uri: 'user1_channel@' + server.host },
expectedStatus: HttpStatusCode.UNAUTHORIZED_401
})
})
url: server.url,
path,
token: server.accessToken,
- fields: { uri: 'user1_channel@localhost:' + server.port },
+ fields: { uri: 'user1_channel@' + server.host },
expectedStatus: HttpStatusCode.NO_CONTENT_204
})
it('Should fail with a non authenticated user', async function () {
await makeGetRequest({
url: server.url,
- path: path + '/user1_channel@localhost:' + server.port,
+ path: path + '/user1_channel@' + server.host,
expectedStatus: HttpStatusCode.UNAUTHORIZED_401
})
})
it('Should fail with an unknown subscription', async function () {
await makeGetRequest({
url: server.url,
- path: path + '/root1@localhost:' + server.port,
+ path: path + '/root1@' + server.host,
token: server.accessToken,
expectedStatus: HttpStatusCode.NOT_FOUND_404
})
it('Should succeed with the correct parameters', async function () {
await makeGetRequest({
url: server.url,
- path: path + '/user1_channel@localhost:' + server.port,
+ path: path + '/user1_channel@' + server.host,
token: server.accessToken,
expectedStatus: HttpStatusCode.OK_200
})
await makeGetRequest({
url: server.url,
path: existPath,
- query: { 'uris[]': 'coucou@localhost:' + server.port },
+ query: { 'uris[]': 'coucou@' + server.host },
token: server.accessToken,
expectedStatus: HttpStatusCode.OK_200
})
it('Should fail with a non authenticated user', async function () {
await makeDeleteRequest({
url: server.url,
- path: path + '/user1_channel@localhost:' + server.port,
+ path: path + '/user1_channel@' + server.host,
expectedStatus: HttpStatusCode.UNAUTHORIZED_401
})
})
it('Should fail with an unknown subscription', async function () {
await makeDeleteRequest({
url: server.url,
- path: path + '/root1@localhost:' + server.port,
+ path: path + '/root1@' + server.host,
token: server.accessToken,
expectedStatus: HttpStatusCode.NOT_FOUND_404
})
it('Should succeed with the correct parameters', async function () {
await makeDeleteRequest({
url: server.url,
- path: path + '/user1_channel@localhost:' + server.port,
+ path: path + '/user1_channel@' + server.host,
token: server.accessToken,
expectedStatus: HttpStatusCode.NO_CONTENT_204
})