5035-intermittent_backTest2 #1365
|
@ -34,6 +34,8 @@ async function test() {
|
||||||
|
|
||||||
const Jasmine = require('jasmine');
|
const Jasmine = require('jasmine');
|
||||||
const jasmine = new Jasmine();
|
const jasmine = new Jasmine();
|
||||||
|
jasmine.seed('02137');
|
||||||
|
// jasmine.randomizeTests(false);
|
||||||
|
|
||||||
const SpecReporter = require('jasmine-spec-reporter').SpecReporter;
|
const SpecReporter = require('jasmine-spec-reporter').SpecReporter;
|
||||||
jasmine.addReporter(new SpecReporter({
|
jasmine.addReporter(new SpecReporter({
|
||||||
|
@ -63,7 +65,7 @@ async function test() {
|
||||||
jasmine.loadConfig({
|
jasmine.loadConfig({
|
||||||
spec_dir: '.',
|
spec_dir: '.',
|
||||||
spec_files: backSpecs,
|
spec_files: backSpecs,
|
||||||
helpers: [],
|
helpers: []
|
||||||
});
|
});
|
||||||
|
|
||||||
await jasmine.execute();
|
await jasmine.execute();
|
||||||
|
|
|
@ -44,7 +44,8 @@ module.exports = Self => {
|
||||||
try {
|
try {
|
||||||
const invoiceOut = await Self.findById(id, null, myOptions);
|
const invoiceOut = await Self.findById(id, null, myOptions);
|
||||||
const hasInvoicing = await models.Account.hasRole(userId, 'invoicing', myOptions);
|
const hasInvoicing = await models.Account.hasRole(userId, 'invoicing', myOptions);
|
||||||
|
console.log(hasInvoicing);
|
||||||
|
console.log(invoiceOut);
|
||||||
if (invoiceOut.hasPdf && !hasInvoicing)
|
if (invoiceOut.hasPdf && !hasInvoicing)
|
||||||
throw new UserError(`You don't have enough privileges`);
|
throw new UserError(`You don't have enough privileges`);
|
||||||
|
|
||||||
|
|
|
@ -66,7 +66,7 @@ describe('InvoiceOut filter()', () => {
|
||||||
|
|
||||||
const result = await models.InvoiceOut.filter(ctx, {id: invoiceOut.id}, options);
|
const result = await models.InvoiceOut.filter(ctx, {id: invoiceOut.id}, options);
|
||||||
|
|
||||||
expect(result.length).toBeGreaterThanOrEqual(1);
|
expect(result.length).toEqual(1);
|
||||||
|
|
||||||
await tx.rollback();
|
await tx.rollback();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|
Loading…
Reference in New Issue