Fixed labs service unit tests

refs d735e3a4f3
refs c7972c20a5

- 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:
Kevin Ansfield 2021-09-14 10:19:26 +01:00
parent d735e3a4f3
commit 0294918eb9

View File

@ -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 () {