Added e2e test covering media inliner job start

refs https://github.com/TryGhost/Toolbox/issues/523

- The test is useful for future iterations of the response format and as a quick reference on which parameters the media inlining endpoint accepts.
This commit is contained in:
Naz 2023-03-06 17:39:22 +08:00
parent 38b356a748
commit 33316a6440
No known key found for this signature in database

View File

@ -84,4 +84,24 @@ describe('DB API', function () {
eventsTriggered['post.deleted'].length.should.eql(7);
eventsTriggered['tag.deleted'].length.should.eql(1);
});
it('Can trigger external media inliner', async function () {
const response = await request
.post(localUtils.API.getApiQuery('db/media/inline'))
.send({
domains: ['https://example.com']
})
.set('Origin', config.get('url'))
.set('Accept', 'application/json')
.expect(200);
// @NOTE: the response format is temporary for test purposes
// before feature graduates to GA, it should become
// a more consistent format
response.body.should.eql({
db: [{
status: 'success'
}]
});
});
});