2021-12-08 13:00:45 +04:00
|
|
|
const {expect} = require('chai');
|
|
|
|
const {any, stringMatching} = require('expect');
|
2021-12-09 17:59:46 +04:00
|
|
|
|
2021-12-07 13:51:08 +04:00
|
|
|
const framework = require('../../../../utils/e2e-framework');
|
2021-03-09 22:10:27 +13:00
|
|
|
|
|
|
|
describe('Config API', function () {
|
2022-02-04 15:32:29 +00:00
|
|
|
let agent;
|
2021-03-09 22:10:27 +13:00
|
|
|
|
|
|
|
before(async function () {
|
2022-02-04 15:32:29 +00:00
|
|
|
agent = await framework.getAgent('/ghost/api/canary/admin/');
|
2021-03-09 22:10:27 +13:00
|
|
|
});
|
|
|
|
|
|
|
|
it('can retrieve config and all expected properties', async function () {
|
2022-02-04 15:32:29 +00:00
|
|
|
const res = await agent
|
2021-12-10 11:05:37 +04:00
|
|
|
.get('site/');
|
2021-03-09 22:10:27 +13:00
|
|
|
|
2021-12-08 13:00:45 +04:00
|
|
|
expect(res.body.site).to.matchSnapshot({
|
|
|
|
version: stringMatching(/\d+\.\d+/)
|
|
|
|
});
|
|
|
|
expect(res.headers).to.matchSnapshot({
|
|
|
|
date: any(String),
|
|
|
|
etag: any(String)
|
|
|
|
});
|
2021-03-09 22:10:27 +13:00
|
|
|
});
|
|
|
|
});
|