Merge branch 'dev' into refactor-e2e-ticketFutureAdvance
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Alexandre Riera 2023-03-06 11:05:00 +00:00
commit 7f076109f5
5 changed files with 4 additions and 5 deletions

View File

@ -44,7 +44,7 @@ module.exports = Self => {
try {
const invoiceOut = await Self.findById(id, null, myOptions);
const hasInvoicing = await models.Account.hasRole(userId, 'invoicing', myOptions);
console.log(invoiceOut, !hasInvoicing);
if (invoiceOut.hasPdf && !hasInvoicing)
throw new UserError(`You don't have enough privileges`);

View File

@ -47,6 +47,7 @@ module.exports = Self => {
ids = ids.split(',');
for (let id of ids) {
console.log(zipConfig, totalSize, zipConfig ? zipConfig.maxSize : null);
if (zipConfig && totalSize > zipConfig.maxSize) throw new UserError('Files are too large');
const invoiceOutPdf = await models.InvoiceOut.download(ctx, id, myOptions);
const fileName = extractFileName(invoiceOutPdf[2]);

View File

@ -11,7 +11,6 @@ describe('InvoiceOut createPdf()', () => {
const ctx = {req: activeCtx};
it('should create a new PDF file and set true the hasPdf property', async() => {
pending('https://redmine.verdnatura.es/issues/5035');
const invoiceId = 1;
spyOn(LoopBackContext, 'getCurrentContext').and.returnValue({
active: activeCtx

View File

@ -30,8 +30,6 @@ describe('InvoiceOut downloadZip()', () => {
});
it('should return an error if the size of the files is too large', async() => {
pending('https://redmine.verdnatura.es/issues/5035');
const tx = await models.InvoiceOut.beginTransaction({});
let error;

View File

@ -65,8 +65,9 @@ describe('InvoiceOut filter()', () => {
await invoiceOut.updateAttribute('hasPdf', true, options);
const result = await models.InvoiceOut.filter(ctx, {id: invoiceOut.id}, options);
console.log(result);
expect(result.length).toBeGreaterThanOrEqual(1);
expect(result.length).toEqual(1);
await tx.rollback();
} catch (e) {