Skip to content

Commit

Permalink
fix: use strings for testing account numbers
Browse files Browse the repository at this point in the history
This commit uses strings to test account numbers to avoid errors when
protractor uses `.indexOf()`.
  • Loading branch information
jniles committed Dec 19, 2017
1 parent eb893cd commit c48dbac
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
14 changes: 7 additions & 7 deletions test/end-to-end/accounts/accounts.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ describe('Account Management', () => {

const account = {
id : 90,
number : 10911010,
number : '10911010',
type : 'Titre',
label : 'Actionnaire, Capital souscrit, non appelé *',
parent : { number : 1091 },
parent : { number : '1091' },
};

const DELETE_ACCOUNT_ID = 87;
Expand Down Expand Up @@ -79,16 +79,16 @@ describe('Account Management', () => {
});

it('creates multiple accounts with the batch option selected', () => {
const parentNumber = 7061; // Services vendus dans la Region ohada
const parentNumber = '7061'; // Services vendus dans la Region ohada

const accounts = [{
number : 70611013,
number : '70611013',
label : 'Pharmacie',
}, {
number : 70611014,
number : '70611014',
label : 'Maternite',
}, {
number : 70611015,
number : '70611015',
label : 'Maternite',
}];

Expand All @@ -113,7 +113,7 @@ describe('Account Management', () => {

page.toggleBatchCreate();

createAccount({ number : 70611016, label : 'Laboratoire' });
createAccount({ number : '70611016', label : 'Laboratoire' });

components.notification.hasSuccess();
});
Expand Down
2 changes: 1 addition & 1 deletion test/end-to-end/vouchers/complex.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ describe('Complex Vouchers', () => {

const detail = {
tool : 'Prise en Charge',
accountNumber : 42210010, // 42210010 - Salaires à payer
accountNumber : '42210010', // 42210010 - Salaires à payer
patientName : 'Test 2',
description : 'Patient Support invoices',
invoices : [0, 1],
Expand Down
12 changes: 6 additions & 6 deletions test/integration/reports/rendering.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
'use strict';
/* global expect, chai, agent */
/* global expect, agent */

const helpers = require('../helpers');
const _ = require('lodash');

// this makes render tests for reports the lazy way. Just give it a target and it will write describe() tests for you.
module.exports = function LazyTester(target, keys, params) {
module.exports = function LazyTester(target, keys, options = {}) {
return function LazyTest() {

params = _.clone(params || {});
const params = _.clone(options);

// renders
const invalid = _.merge({ renderer : 'unknown' }, params);
Expand Down Expand Up @@ -40,14 +38,16 @@ module.exports = function LazyTester(target, keys, params) {
});

it(`GET ${target} should return PDF data for 'pdf' rendering target`, function () {
this.timeout(5000);
return agent.get(target)
.query(pdf)
.then(expectPDFReport)
.catch(helpers.handler);
});

it(`GET ${target} should return the default PDF renderer if no rendering target`, function () {
let parameters = _.clone(params);
this.timeout(5000);
const parameters = _.clone(params);
delete parameters.renderer;
return agent.get(target)
.query(parameters)
Expand Down

0 comments on commit c48dbac

Please sign in to comment.