0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-03 23:00:14 -05:00
ghost/test/unit/data/meta/blog_logo_spec.js
Hannah Wolfe 7f1d3ebc07
Move tests from core to root (#11700)
- move all test files from core/test to test/
- updated all imports and other references
- all code inside of core/ is then application code
- tests are correctly at the root level
- consistent with other repos/projects

Co-authored-by: Kevin Ansfield <kevin@lookingsideways.co.uk>
2020-03-30 16:26:47 +01:00

40 lines
1.2 KiB
JavaScript

var should = require('should'),
getBlogLogo = require('../../../../core/frontend/meta/blog_logo'),
sinon = require('sinon'),
settingsCache = require('../../../../core/server/services/settings/cache');
describe('getBlogLogo', function () {
afterEach(function () {
sinon.restore();
});
it('should return logo if uploaded', function () {
var blogLogo;
sinon.stub(settingsCache, 'get').callsFake(function (key) {
return {
logo: '/content/images/logo.png',
icon: null
}[key];
});
blogLogo = getBlogLogo();
should.exist(blogLogo);
blogLogo.should.have.property('url', 'http://127.0.0.1:2369/content/images/logo.png');
});
it('should return custom uploaded png icon if no logo given', function () {
var blogLogo;
sinon.stub(settingsCache, 'get').callsFake(function (key) {
return {
logo: null,
icon: '/content/images/favicon.png'
}[key];
});
blogLogo = getBlogLogo();
should.exist(blogLogo);
blogLogo.should.have.property('url', 'http://127.0.0.1:2369/favicon.png');
});
});