settings: move branding settings into branding.js
This commit is contained in:
@@ -7,7 +7,6 @@
|
||||
|
||||
const branding = require('../branding.js'),
|
||||
common = require('./common.js'),
|
||||
constants = require('../constants.js'),
|
||||
expect = require('expect.js');
|
||||
|
||||
describe('Branding', function () {
|
||||
@@ -16,15 +15,27 @@ describe('Branding', function () {
|
||||
before(setup);
|
||||
after(cleanup);
|
||||
|
||||
it ('can get default cloudron name', async function () {
|
||||
const name = await branding.getCloudronName();
|
||||
expect(name).to.be('Cloudron');
|
||||
});
|
||||
|
||||
it('can get default cloudron avatar', async function () {
|
||||
const avatar = await branding.getCloudronAvatar();
|
||||
expect(avatar).to.be.a(Buffer);
|
||||
});
|
||||
|
||||
it('can render default footer', async function () {
|
||||
expect(branding.renderFooter(constants.FOOTER)).to.contain('(https://cloudron.io)');
|
||||
expect(await branding.renderFooter()).to.contain('(https://cloudron.io)');
|
||||
});
|
||||
|
||||
it('can render footer', async function () {
|
||||
expect(branding.renderFooter('BigFoot Inc')).to.be('BigFoot Inc');
|
||||
await branding.setFooter('BigFoot Inc');
|
||||
expect(await branding.renderFooter()).to.be('BigFoot Inc');
|
||||
});
|
||||
|
||||
it('can render footer with YEAR', async function () {
|
||||
expect(branding.renderFooter('BigFoot Inc %YEAR%')).to.be('BigFoot Inc 2023');
|
||||
await branding.setFooter('BigFoot Inc %YEAR%');
|
||||
expect(await branding.renderFooter()).to.be('BigFoot Inc 2023');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user