mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-25 20:03:12 +03:00
Fixed labs service unit tests
refsd735e3a4f3
refsc7972c20a5
- the unit tests are currently tied to the labs service data rather than testing independent behaviour meaning that the test needs to be updated when the particular alpha flag they are tied to gets removed
This commit is contained in:
parent
d735e3a4f3
commit
0294918eb9
@ -22,16 +22,16 @@ describe('Labs Service', function () {
|
||||
sinon.stub(process.env, 'NODE_ENV').value('production');
|
||||
sinon.stub(settingsCache, 'get');
|
||||
settingsCache.get.withArgs('labs').returns({
|
||||
dashboardTwo: true
|
||||
emailOnlyPosts: true
|
||||
});
|
||||
|
||||
labs.getAll().should.eql({
|
||||
dashboardTwo: true,
|
||||
emailOnlyPosts: true,
|
||||
members: true
|
||||
});
|
||||
|
||||
labs.isSet('members').should.be.true;
|
||||
labs.isSet('dashboardTwo').should.be.true;
|
||||
labs.isSet('emailOnlyPosts').should.be.true;
|
||||
});
|
||||
|
||||
it('returns a falsy alpha flag when dev experiments in NOT toggled', function () {
|
||||
@ -39,7 +39,7 @@ describe('Labs Service', function () {
|
||||
sinon.stub(process.env, 'NODE_ENV').value('production');
|
||||
sinon.stub(settingsCache, 'get');
|
||||
settingsCache.get.withArgs('labs').returns({
|
||||
dashboardTwo: true
|
||||
emailOnlyPosts: true
|
||||
});
|
||||
|
||||
labs.getAll().should.eql({
|
||||
@ -47,7 +47,7 @@ describe('Labs Service', function () {
|
||||
});
|
||||
|
||||
labs.isSet('members').should.be.true;
|
||||
labs.isSet('dashboardTwo').should.be.false;
|
||||
labs.isSet('emailOnlyPosts').should.be.false;
|
||||
});
|
||||
|
||||
it('members flag is true when members_signup_access setting is "all"', function () {
|
||||
|
Loading…
Reference in New Issue
Block a user