mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-14 20:40:17 -05:00
Merge pull request #21232 from overleaf/mf-remove-use-advanced-search
[web] Remove advance gallery search GitOrigin-RevId: af39f63ac0483fe2540ba737f0239d0b503f87fe
This commit is contained in:
parent
5182e9a883
commit
6c83f85d5d
3 changed files with 0 additions and 62 deletions
|
@ -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 }
|
|
@ -101,7 +101,6 @@
|
|||
"administration_and_security": "Administration and security",
|
||||
"advanced_reference_search": "Advanced <0>reference search</0>",
|
||||
"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",
|
||||
|
|
|
@ -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
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
Loading…
Reference in a new issue