mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-06 22:40:14 -05:00
Removed forceStart in theme e2e tests
refs https://github.com/TryGhost/Toolbox/issues/135 - The reason the test **settings** test was failing when the force start flag was removed in the **custom themes** was the bridge! The bridge was trying to execute function on the frontend when the boot was done without initializing the frontend. The setting test was changing locale and the timezone which triggered events calling up on frontend components - we clearly don't want to do this when the instance is booted without the frontend - To make event initialization conditional moved it to the "init". This way the event listeners are only set up when we boot with the "frontend" flag set to true
This commit is contained in:
parent
3a6efc73b3
commit
23ba543abd
3 changed files with 5 additions and 4 deletions
|
@ -183,6 +183,7 @@ async function initDynamicRouting() {
|
|||
const routing = require('./frontend/services/routing');
|
||||
const routeSettingsService = require('./server/services/route-settings');
|
||||
const bridge = require('./bridge');
|
||||
bridge.init();
|
||||
|
||||
// We pass the frontend API version + the dynamic routes here, so that the frontend services are slightly less tightly-coupled
|
||||
const apiVersion = bridge.getFrontendApiVersion();
|
||||
|
|
|
@ -27,7 +27,7 @@ const messages = {
|
|||
};
|
||||
|
||||
class Bridge {
|
||||
constructor() {
|
||||
init() {
|
||||
/**
|
||||
* When locale changes, we reload theme translations
|
||||
* @deprecated: the term "lang" was deprecated in favor of "locale" publicly in 4.0
|
||||
|
|
|
@ -11,14 +11,14 @@ describe('Custom Theme Settings API', function () {
|
|||
before(async function () {
|
||||
// NOTE: needs force start to be able to reinitialize Ghost process with frontend services - custom-theme-settings, to be specific
|
||||
await localUtils.startGhost({
|
||||
forceStart: true,
|
||||
frontend: true
|
||||
});
|
||||
request = supertest.agent(config.get('url'));
|
||||
await localUtils.doAuth(request, 'users:extra', 'custom_theme_settings');
|
||||
|
||||
// require here so we know it's already been set up with models
|
||||
// require and init here so we know it's already been set up with models
|
||||
const customThemeSettingsService = require('../../../core/server/services/custom-theme-settings');
|
||||
await customThemeSettingsService.init();
|
||||
|
||||
// fake a theme activation with custom settings - settings match fixtures
|
||||
await customThemeSettingsService.api.activateTheme('casper', {
|
||||
name: 'casper',
|
||||
|
|
Loading…
Reference in a new issue