mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-10 23:36:14 -05:00
refs https://github.com/TryGhost/Toolbox/issues/158 - Allows for much smaller amount of code to configure a test to work with chai-jest-snapshots. They now work automatically for all regression tests and could be enabled for other suites by adding the "--require=./test/utils/snapshots.js" parameter in respective test:* package script - Regenerated snapshot for authentication test as the naming structure changed a little with the snapshot metadata being taken on a higher level in the test (uses the suite name instead of a specific describe it used to be called from)
27 lines
802 B
JavaScript
27 lines
802 B
JavaScript
const {expect} = require('chai');
|
|
const {any, stringMatching} = require('expect');
|
|
|
|
const framework = require('../../../../utils/e2e-framework');
|
|
const config = require('../../../../../core/shared/config');
|
|
|
|
describe('Config API', function () {
|
|
let request;
|
|
|
|
before(async function () {
|
|
request = await framework.getAgent('/ghost/api/canary/admin/');
|
|
});
|
|
|
|
it('can retrieve config and all expected properties', async function () {
|
|
const res = await request
|
|
.get('site/')
|
|
.set('Origin', config.get('url'));
|
|
|
|
expect(res.body.site).to.matchSnapshot({
|
|
version: stringMatching(/\d+\.\d+/)
|
|
});
|
|
expect(res.headers).to.matchSnapshot({
|
|
date: any(String),
|
|
etag: any(String)
|
|
});
|
|
});
|
|
});
|