mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-02 05:41:33 +02:00
Merge pull request #28589 from overleaf/revert-28283-jdt-monthly-tl-experiment
Revert "Rolling TexLive builds experiment" GitOrigin-RevId: c3c6833dca7ef0d207f854c93bf0bb03bd814694
This commit is contained in:
@@ -4,12 +4,6 @@ const { ObjectId } = require('mongodb-legacy')
|
||||
|
||||
const MODULE_PATH = '../../../../app/src/Features/Project/ProjectHelper.js'
|
||||
|
||||
function _mapToAllowed(images) {
|
||||
return images.map(image => {
|
||||
return { imageName: image.imageName, allowed: image.allowed }
|
||||
})
|
||||
}
|
||||
|
||||
describe('ProjectHelper', function () {
|
||||
beforeEach(function () {
|
||||
this.project = {
|
||||
@@ -20,8 +14,6 @@ describe('ProjectHelper', function () {
|
||||
_id: '588f3ddae8ebc1bac07c9fa4',
|
||||
first_name: 'bjkdsjfk',
|
||||
features: {},
|
||||
labsProgram: true,
|
||||
labsExperiments: ['monthly-texlive'],
|
||||
}
|
||||
|
||||
this.adminUser = {
|
||||
@@ -40,11 +32,6 @@ describe('ProjectHelper', function () {
|
||||
imageDesc: 'TeX Live 2020',
|
||||
alphaOnly: true,
|
||||
},
|
||||
{
|
||||
imageName: 'texlive-full:2021.1',
|
||||
imageDesc: 'TeX Live 2021',
|
||||
monthlyExperimental: true,
|
||||
},
|
||||
],
|
||||
}
|
||||
|
||||
@@ -141,58 +128,31 @@ describe('ProjectHelper', function () {
|
||||
})
|
||||
|
||||
describe('getAllowedImagesForUser', function () {
|
||||
it('marks alpha only images as not allowed when the user is anonymous', function () {
|
||||
it('filters out alpha-only images when the user is anonymous', function () {
|
||||
const images = this.ProjectHelper.getAllowedImagesForUser(null)
|
||||
const imageNames = _mapToAllowed(images)
|
||||
const imageNames = images.map(image => image.imageName)
|
||||
expect(imageNames).to.deep.equal([
|
||||
{ imageName: 'texlive-full:2018.1', allowed: true },
|
||||
{ imageName: 'texlive-full:2019.1', allowed: true },
|
||||
{ imageName: 'texlive-full:2020.1', allowed: false },
|
||||
{ imageName: 'texlive-full:2021.1', allowed: false },
|
||||
'texlive-full:2018.1',
|
||||
'texlive-full:2019.1',
|
||||
])
|
||||
})
|
||||
|
||||
it('marks monthly labs images as not allowed when the user is anonymous', function () {
|
||||
const images = this.ProjectHelper.getAllowedImagesForUser(null)
|
||||
const imageNames = _mapToAllowed(images)
|
||||
expect(imageNames).to.deep.equal([
|
||||
{ imageName: 'texlive-full:2018.1', allowed: true },
|
||||
{ imageName: 'texlive-full:2019.1', allowed: true },
|
||||
{ imageName: 'texlive-full:2020.1', allowed: false },
|
||||
{ imageName: 'texlive-full:2021.1', allowed: false },
|
||||
])
|
||||
})
|
||||
|
||||
it('marks monthly labs images as allowed when the user is enrolled', function () {
|
||||
it('filters out alpha-only images when the user is not admin', function () {
|
||||
const images = this.ProjectHelper.getAllowedImagesForUser(this.user)
|
||||
const imageNames = _mapToAllowed(images)
|
||||
const imageNames = images.map(image => image.imageName)
|
||||
expect(imageNames).to.deep.equal([
|
||||
{ imageName: 'texlive-full:2018.1', allowed: true },
|
||||
{ imageName: 'texlive-full:2019.1', allowed: true },
|
||||
{ imageName: 'texlive-full:2020.1', allowed: false },
|
||||
{ imageName: 'texlive-full:2021.1', allowed: true },
|
||||
])
|
||||
})
|
||||
|
||||
it('marks alpha only images as not allowed when when the user is not admin', function () {
|
||||
const images = this.ProjectHelper.getAllowedImagesForUser(this.user)
|
||||
const imageNames = _mapToAllowed(images)
|
||||
expect(imageNames).to.deep.equal([
|
||||
{ imageName: 'texlive-full:2018.1', allowed: true },
|
||||
{ imageName: 'texlive-full:2019.1', allowed: true },
|
||||
{ imageName: 'texlive-full:2020.1', allowed: false },
|
||||
{ imageName: 'texlive-full:2021.1', allowed: true },
|
||||
'texlive-full:2018.1',
|
||||
'texlive-full:2019.1',
|
||||
])
|
||||
})
|
||||
|
||||
it('returns all images when the user is admin', function () {
|
||||
const images = this.ProjectHelper.getAllowedImagesForUser(this.adminUser)
|
||||
const imageNames = _mapToAllowed(images)
|
||||
const imageNames = images.map(image => image.imageName)
|
||||
expect(imageNames).to.deep.equal([
|
||||
{ imageName: 'texlive-full:2018.1', allowed: true },
|
||||
{ imageName: 'texlive-full:2019.1', allowed: true },
|
||||
{ imageName: 'texlive-full:2020.1', allowed: true },
|
||||
{ imageName: 'texlive-full:2021.1', allowed: false },
|
||||
'texlive-full:2018.1',
|
||||
'texlive-full:2019.1',
|
||||
'texlive-full:2020.1',
|
||||
])
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user