Ghost/test/unit/services/labs_spec.js
Naz d0e0760dae Hardcoded labs to always return members:true
refs https://github.com/TryGhost/Ghost/issues/10318

- Because members is effectively "enabled" by default starting Ghost 4.0 have hardcoded labs setting to be such. The alternative of removing this key from labs would be equivalent to `labs.members === false` which is undesireable and would mean additional work on theme developer's side.
2021-02-17 19:55:16 +13:00

28 lines
703 B
JavaScript

const should = require('should');
const sinon = require('sinon');
const labs = require('../../../core/server/services/labs');
describe('Labs Service', function () {
afterEach(function () {
sinon.restore();
});
it('always returns members true flag', function () {
labs.getAll().should.eql({
members: true
});
labs.isSet('members').should.be.true;
});
it('isSet returns false for undefined', function () {
labs.isSet('bar').should.be.false;
});
it('isSet always returns false for deprecated', function () {
labs.isSet('subscribers').should.be.false;
labs.isSet('publicAPI').should.be.false;
});
});