mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-30 14:22:07 +03:00
c687df21e1
refs: bf0823c9a2
- continuing the work of splitting up the theme service into logical components
36 lines
1.1 KiB
JavaScript
36 lines
1.1 KiB
JavaScript
const should = require('should');
|
|
const sinon = require('sinon');
|
|
const themeConfig = require('../../../../core/frontend/services/theme-engine/config');
|
|
|
|
describe('Themes', function () {
|
|
afterEach(function () {
|
|
sinon.restore();
|
|
});
|
|
|
|
describe('Config', function () {
|
|
it('handles no package.json', function () {
|
|
const config = themeConfig.create();
|
|
|
|
config.should.eql({posts_per_page: 5});
|
|
});
|
|
|
|
it('handles package.json without config', function () {
|
|
const config = themeConfig.create({name: 'casper'});
|
|
|
|
config.should.eql({posts_per_page: 5});
|
|
});
|
|
|
|
it('handles allows package.json to overrideg default', function () {
|
|
const config = themeConfig.create({name: 'casper', config: {posts_per_page: 3}});
|
|
|
|
config.should.eql({posts_per_page: 3});
|
|
});
|
|
|
|
it('handles ignores non-allowed config', function () {
|
|
const config = themeConfig.create({name: 'casper', config: {magic: 'roundabout'}});
|
|
|
|
config.should.eql({posts_per_page: 5});
|
|
});
|
|
});
|
|
});
|