0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-03-04 02:01:58 -05:00
ghost/test/regression/api/admin/site.test.js
Hannah Wolfe 5210e84b26
Improved e2e-framework API
- encapsulated concerns within individual objects
- this will allow us to refactor these into classes or move them around later
- also makes it clearer how methods like restore relate to other methods
- e.g mocks.restore() restores mocks, whilst fixtureManager.restore() restores the database
2022-02-07 16:09:54 +00:00

25 lines
696 B
JavaScript

const {expect} = require('chai');
const {any, stringMatching} = require('expect');
const {agentProvider} = require('../../../utils/e2e-framework');
describe('Config API', function () {
let agent;
before(async function () {
agent = await agentProvider.getAgent('/ghost/api/canary/admin/');
});
it('can retrieve config and all expected properties', async function () {
const res = await agent
.get('site/');
expect(res.body.site).to.matchSnapshot({
version: stringMatching(/\d+\.\d+/)
});
expect(res.headers).to.matchSnapshot({
date: any(String),
etag: any(String)
});
});
});