|
|
@@ -41,6 +41,11 @@ describe('ProjectUploadController', function () {
|
|
|
ctx.EditorController = {
|
|
|
promises: {},
|
|
|
}
|
|
|
+ ctx.ProjectOptionsHandler = {
|
|
|
+ promises: {
|
|
|
+ setCompiler: sinon.stub().resolves(),
|
|
|
+ },
|
|
|
+ }
|
|
|
ctx.DocumentConversionManager = {
|
|
|
promises: {
|
|
|
convertDocxToLaTeXZipArchive: sinon.stub(),
|
|
|
@@ -93,6 +98,13 @@ describe('ProjectUploadController', function () {
|
|
|
default: ctx.EditorController,
|
|
|
}))
|
|
|
|
|
|
+ vi.doMock(
|
|
|
+ '../../../../app/src/Features/Project/ProjectOptionsHandler',
|
|
|
+ () => ({
|
|
|
+ default: ctx.ProjectOptionsHandler,
|
|
|
+ })
|
|
|
+ )
|
|
|
+
|
|
|
vi.doMock(
|
|
|
'../../../../app/src/Features/Uploads/DocumentConversionManager.mjs',
|
|
|
() => ({
|
|
|
@@ -477,6 +489,12 @@ describe('ProjectUploadController', function () {
|
|
|
).to.have.been.calledWith(ctx.user_id, 'file', ctx.archivePath)
|
|
|
})
|
|
|
|
|
|
+ it('should set the compiler to lualatex', function (ctx) {
|
|
|
+ expect(
|
|
|
+ ctx.ProjectOptionsHandler.promises.setCompiler
|
|
|
+ ).to.have.been.calledWith('new-project-id', 'lualatex')
|
|
|
+ })
|
|
|
+
|
|
|
it('should unlink the archive after creating the project', function (ctx) {
|
|
|
expect(ctx.fsPromises.unlink).to.have.been.calledWith(ctx.archivePath)
|
|
|
})
|