Merge pull request #18993 from overleaf/jpa-test-xelatex

[server-pro] add tests for using XeLaTeX

GitOrigin-RevId: 66c602c930a4dd0888e88f2f90bd587ee16a7a64
This commit is contained in:
Jakob Ackermann 2024-06-19 13:19:44 +02:00 committed by Copybot
parent be23b7e73b
commit 8bc9ce3b52

View file

@ -46,8 +46,40 @@ describe('SandboxedCompiles', function () {
cy.get('[aria-label="View logs"]').click() cy.get('[aria-label="View logs"]').click()
cy.findByText(/This is pdfTeX, Version .+ \(TeX Live 2022\) /) cy.findByText(/This is pdfTeX, Version .+ \(TeX Live 2022\) /)
}) })
checkXeTeX()
}) })
function checkXeTeX() {
it('should be able to use XeLaTeX', () => {
cy.visit('/project')
createProject('XeLaTeX')
const recompile = throttledRecompile()
cy.log('wait for compile')
cy.get('.pdf-viewer').should('contain.text', 'XeLaTeX')
cy.log('Check which compiler was used, expect pdfLaTeX')
cy.get('[aria-label="View logs"]').click()
cy.findByText(/This is pdfTeX/)
cy.log('Switch compiler to from pdfLaTeX to XeLaTeX')
cy.get('header').findByText('Menu').click()
cy.findByText('Compiler')
.parent()
.findByText('pdfLaTeX')
.parent()
.select('XeLaTeX')
cy.get('#left-menu-modal').click()
cy.log('Trigger compile with other compiler')
recompile()
cy.log('Check which compiler was used, expect XeLaTeX')
cy.get('[aria-label="View logs"]').click()
cy.findByText(/This is XeTeX/)
})
}
function checkUsesDefaultCompiler() { function checkUsesDefaultCompiler() {
beforeEach(function () { beforeEach(function () {
login('user@example.com') login('user@example.com')
@ -70,11 +102,13 @@ describe('SandboxedCompiles', function () {
startWith({ pro: true }) startWith({ pro: true })
checkUsesDefaultCompiler() checkUsesDefaultCompiler()
checkXeTeX()
}) })
describe.skip('unavailable in CE', () => { describe.skip('unavailable in CE', () => {
startWith({ pro: false, vars: enabledVars }) startWith({ pro: false, vars: enabledVars })
checkUsesDefaultCompiler() checkUsesDefaultCompiler()
checkXeTeX()
}) })
}) })