mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-02 13:20:23 -05:00
716f186fed
GitOrigin-RevId: 856c523a4ca34f8ccdc38067cef6fcd8a5c20250
68 lines
1.4 KiB
TypeScript
68 lines
1.4 KiB
TypeScript
import { v4 as uuid } from 'uuid'
|
|
|
|
const outputFiles = () => {
|
|
const build = uuid()
|
|
|
|
return [
|
|
{
|
|
path: 'output.pdf',
|
|
build,
|
|
url: `/build/${build}/output.pdf`,
|
|
type: 'pdf',
|
|
},
|
|
{
|
|
path: 'output.bbl',
|
|
build,
|
|
url: `/build/${build}/output.bbl`,
|
|
type: 'bbl',
|
|
},
|
|
{
|
|
path: 'output.bib',
|
|
build,
|
|
url: `/build/${build}/output.bib`,
|
|
type: 'bib',
|
|
},
|
|
{
|
|
path: 'example.txt',
|
|
build,
|
|
url: `/build/${build}/example.txt`,
|
|
type: 'txt',
|
|
},
|
|
{
|
|
path: 'output.log',
|
|
build,
|
|
url: `/build/${build}/output.log`,
|
|
type: 'log',
|
|
},
|
|
{
|
|
path: 'output.blg',
|
|
build,
|
|
url: `/build/${build}/output.blg`,
|
|
type: 'blg',
|
|
},
|
|
]
|
|
}
|
|
|
|
export const interceptCompile = (prefix = 'compile') => {
|
|
cy.intercept('POST', '/project/*/compile*', {
|
|
body: {
|
|
status: 'success',
|
|
clsiServerId: 'foo',
|
|
compileGroup: 'priority',
|
|
pdfDownloadDomain: 'https://clsi.test-overleaf.com',
|
|
outputFiles: outputFiles(),
|
|
},
|
|
}).as(`${prefix}`)
|
|
|
|
cy.intercept('/build/*/output.pdf*', {
|
|
fixture: 'build/output.pdf,null',
|
|
}).as(`${prefix}-pdf`)
|
|
|
|
cy.intercept('/build/*/output.log*', {
|
|
fixture: 'build/output.log',
|
|
}).as(`${prefix}-log`)
|
|
|
|
cy.intercept('/build/*/output.blg*', {
|
|
fixture: 'build/output.blg',
|
|
}).as(`${prefix}-blg`)
|
|
}
|