diff --git a/services/web/app/src/Features/Helpers/FeatureFlag.js b/services/web/app/src/Features/Helpers/FeatureFlag.js deleted file mode 100644 index 44f0b812aa..0000000000 --- a/services/web/app/src/Features/Helpers/FeatureFlag.js +++ /dev/null @@ -1,9 +0,0 @@ -function shouldDisplayFeature(req, name, variantFlag) { - if (req.query && req.query[name]) { - return req.query[name] === 'true' - } else { - return variantFlag === true - } -} - -module.exports = { shouldDisplayFeature } diff --git a/services/web/locales/en.json b/services/web/locales/en.json index 98324f0f9c..4799f4197b 100644 --- a/services/web/locales/en.json +++ b/services/web/locales/en.json @@ -101,7 +101,6 @@ "administration_and_security": "Administration and security", "advanced_reference_search": "Advanced <0>reference search", "advanced_reference_search_mode": "Advanced reference search", - "advanced_search": "Advanced Search", "aggregate_changed": "Changed", "aggregate_to": "to", "agree_with_the_terms": "I agree with the Overleaf terms", diff --git a/services/web/test/unit/src/HelperFiles/FeatureFlagTests.js b/services/web/test/unit/src/HelperFiles/FeatureFlagTests.js deleted file mode 100644 index bb31a5afab..0000000000 --- a/services/web/test/unit/src/HelperFiles/FeatureFlagTests.js +++ /dev/null @@ -1,52 +0,0 @@ -const { expect } = require('chai') -const SandboxedModule = require('sandboxed-module') -const modulePath = require('path').join( - __dirname, - '../../../../app/src/Features/Helpers/FeatureFlag' -) - -describe('FeatureFlag', function () { - beforeEach(function () { - this.FeatureFlag = SandboxedModule.require(modulePath, {}) - }) - - describe('shouldDisplayFeature', function () { - describe('no req.query', function () { - const req = {} - it('should return false when variantFlag=false', function () { - expect(this.FeatureFlag.shouldDisplayFeature(req, '', false)).to.be - .false - }) - it('should return true when variantFlag=true', function () { - expect(this.FeatureFlag.shouldDisplayFeature(req, '', true)).to.be.true - }) - }) - - describe('req.query but no query param', function () { - const req = { query: {} } - it('should return false when variantFlag=false', function () { - expect(this.FeatureFlag.shouldDisplayFeature(req, '', false)).to.be - .false - }) - it('should return true when variantFlag=true', function () { - expect(this.FeatureFlag.shouldDisplayFeature(req, '', true)).to.be.true - }) - }) - - describe('req.query[name] exists', function () { - const paramName = 'test' - const req = { query: {} } - - it('should return false when value is not "true"', function () { - req.query[paramName] = 'nope' - expect(this.FeatureFlag.shouldDisplayFeature(req, paramName, false)).to - .be.false - }) - it('should return true when value is "true"', function () { - req.query[paramName] = 'true' - expect(this.FeatureFlag.shouldDisplayFeature(req, paramName, false)).to - .be.true - }) - }) - }) -})