2017-09-04 21:21:47 +02:00
|
|
|
import * as request from 'supertest'
|
2020-01-31 16:56:52 +01:00
|
|
|
import { URL } from 'url'
|
2020-12-07 14:32:36 +01:00
|
|
|
import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes'
|
2017-09-04 21:21:47 +02:00
|
|
|
|
|
|
|
function getClient (url: string) {
|
2017-09-07 17:58:09 +02:00
|
|
|
const path = '/api/v1/oauth-clients/local'
|
2017-09-04 21:21:47 +02:00
|
|
|
|
|
|
|
return request(url)
|
|
|
|
.get(path)
|
2020-01-31 16:56:52 +01:00
|
|
|
.set('Host', new URL(url).host)
|
2017-09-04 21:21:47 +02:00
|
|
|
.set('Accept', 'application/json')
|
2020-12-07 14:32:36 +01:00
|
|
|
.expect(HttpStatusCode.OK_200)
|
2017-09-04 21:21:47 +02:00
|
|
|
.expect('Content-Type', /json/)
|
|
|
|
}
|
|
|
|
|
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
export {
|
|
|
|
getClient
|
|
|
|
}
|