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:
parent
1096488446
commit
3407df7c1c
1 changed files with 3 additions and 1 deletions
|
@ -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);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue