diff --git a/back/tests.js b/back/tests.js index ab6893791..20118c0e0 100644 --- a/back/tests.js +++ b/back/tests.js @@ -34,6 +34,8 @@ async function test() { const Jasmine = require('jasmine'); const jasmine = new Jasmine(); + jasmine.seed('02137'); + // jasmine.randomizeTests(false); const SpecReporter = require('jasmine-spec-reporter').SpecReporter; jasmine.addReporter(new SpecReporter({ @@ -63,7 +65,7 @@ async function test() { jasmine.loadConfig({ spec_dir: '.', spec_files: backSpecs, - helpers: [], + helpers: [] }); await jasmine.execute(); diff --git a/modules/invoiceOut/back/methods/invoiceOut/createPdf.js b/modules/invoiceOut/back/methods/invoiceOut/createPdf.js index e56516237..18b5e796a 100644 --- a/modules/invoiceOut/back/methods/invoiceOut/createPdf.js +++ b/modules/invoiceOut/back/methods/invoiceOut/createPdf.js @@ -44,7 +44,8 @@ module.exports = Self => { try { const invoiceOut = await Self.findById(id, null, myOptions); const hasInvoicing = await models.Account.hasRole(userId, 'invoicing', myOptions); - + console.log(hasInvoicing); + console.log(invoiceOut); if (invoiceOut.hasPdf && !hasInvoicing) throw new UserError(`You don't have enough privileges`); diff --git a/modules/invoiceOut/back/methods/invoiceOut/specs/filter.spec.js b/modules/invoiceOut/back/methods/invoiceOut/specs/filter.spec.js index d3d789393..15e3e887e 100644 --- a/modules/invoiceOut/back/methods/invoiceOut/specs/filter.spec.js +++ b/modules/invoiceOut/back/methods/invoiceOut/specs/filter.spec.js @@ -66,7 +66,7 @@ describe('InvoiceOut filter()', () => { const result = await models.InvoiceOut.filter(ctx, {id: invoiceOut.id}, options); - expect(result.length).toBeGreaterThanOrEqual(1); + expect(result.length).toEqual(1); await tx.rollback(); } catch (e) {