Prepare new Pdf Preview rollout (#5664)

* Prepare new pdf preview rollout
* skip new_logs_ui variant tests

GitOrigin-RevId: 047a3c636e09e9786c2a9b93514fef5bc46b0da9
This commit is contained in:
Miguel Serrano 2021-11-10 11:08:46 +01:00 committed by Copybot
parent 7d8c1397be
commit 19eef0acca
4 changed files with 32 additions and 2 deletions

View file

@ -38,6 +38,7 @@ function _getVariantForPercentile(percentile) {
}
}
// eslint-disable-next-line no-unused-vars
function getNewLogsUIVariantForUser(user) {
const { _id: userId, alphaProgram: isAlphaUser } = user
const isSaaS = Boolean(Settings.overleaf)
@ -56,5 +57,7 @@ function getNewLogsUIVariantForUser(user) {
}
module.exports = {
getNewLogsUIVariantForUser,
// We're disabling the split tests while rolling out the PDF Preview
// https://github.com/overleaf/internal/issues/5553
getNewLogsUIVariantForUser: () => EXISTING_UI,
}

View file

@ -733,8 +733,27 @@ const ProjectController = {
}
)
},
newPdfPreviewAssignment(cb) {
SplitTestV2Handler.getAssignmentForSession(
req.session,
'new-pdf-preview',
(err, assignment) => {
cb(err, assignment)
}
)
},
(err, { project, user, subscription, isTokenMember, brandVariation }) => {
},
(
err,
{
project,
user,
subscription,
isTokenMember,
brandVariation,
newPdfPreviewAssignment,
}
) => {
if (err != null) {
OError.tag(err, 'error getting details for project page')
return next(err)

View file

@ -9,6 +9,11 @@ const MODULE_PATH = require('path').join(
describe('NewLogsUI helper', function () {
let NewLogsUI
before(function () {
// We're disabling the Logs UI split test while rolling out the PDF Preview
this.skip()
})
function userIdFromTime(time) {
return ObjectId.createFromTime(time).toString()
}

View file

@ -139,6 +139,9 @@ describe('ProjectController', function () {
getAssignment: sinon.stub().resolves({ active: false }),
assignInLocalsContext: sinon.stub().resolves(),
},
getAssignmentForSession: sinon
.stub()
.yields(null, { variant: 'variant' }),
getAssignment: sinon.stub().yields(null, { active: false }),
assignInLocalsContext: sinon.stub().yields(null),
}