2017-10-16 04:05:49 -04:00
|
|
|
import * as request from 'supertest'
|
2020-12-07 08:32:36 -05:00
|
|
|
import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes'
|
2017-10-16 04:05:49 -04:00
|
|
|
|
|
|
|
function getOEmbed (url: string, oembedUrl: string, format?: string, maxHeight?: number, maxWidth?: number) {
|
|
|
|
const path = '/services/oembed'
|
|
|
|
const query = {
|
|
|
|
url: oembedUrl,
|
|
|
|
format,
|
|
|
|
maxheight: maxHeight,
|
|
|
|
maxwidth: maxWidth
|
|
|
|
}
|
|
|
|
|
|
|
|
return request(url)
|
|
|
|
.get(path)
|
|
|
|
.query(query)
|
|
|
|
.set('Accept', 'application/json')
|
2020-12-07 08:32:36 -05:00
|
|
|
.expect(HttpStatusCode.OK_200)
|
2017-10-16 04:05:49 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
export {
|
|
|
|
getOEmbed
|
|
|
|
}
|