0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-03-11 02:12:21 -05:00

Fixed stubbing of labs data

no-issue

Labs data is read from the labs service not the settings cache, so we
should be stubbing this to ensure that the tests run correctly.
This commit is contained in:
Fabien egg O'Carroll 2021-12-01 16:11:27 +02:00
parent 1096488446
commit 3407df7c1c

View file

@ -6,6 +6,7 @@ const middleware = require('../../../../../core/frontend/services/theme-engine')
const activeTheme = require('../../../../../core/frontend/services/theme-engine/active');
const settingsCache = require('../../../../../core/shared/settings-cache');
const customThemeSettingsCache = require('../../../../../core/shared/custom-theme-settings-cache');
const labs = require('../../../../../core/shared/labs');
const sandbox = sinon.createSandbox();
@ -67,9 +68,10 @@ describe('Themes middleware', function () {
.returns(fakeActiveTheme);
sandbox.stub(settingsCache, 'get')
.withArgs('labs').returns(fakeLabsData)
.withArgs('active_theme').returns(fakeActiveThemeName);
sandbox.stub(labs, 'getAll').returns(fakeLabsData);
sandbox.stub(settingsCache, 'getPublic')
.returns(fakeSiteData);