Skip to content

Commit

Permalink
fix(cash): fixes the cash e2e test
Browse files Browse the repository at this point in the history
This commit fixes an error in the cash e2e test that somehow began
choosing a patient without invoices to bill for invoices.
  • Loading branch information
jniles committed Mar 24, 2016
1 parent 593270e commit a12d1db
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions client/test/e2e/cash/cash.spec.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
/* global inject, browser, element, by, protractor */
/* global browser, element, by, protractor */

var chai = require('chai');
var chaiAsPromised = require('chai-as-promised');
var expect = chai.expect;
chai.use(chaiAsPromised);

// import testing utiliites
var helpers = require('../shared/helpers');
helpers.configure(chai);

var components = require('../shared/components');
var GU = require('../shared/gridTestUtils.spec.js');
var EC = protractor.ExpectedConditions;
var FU = require('../shared/FormUtils');


describe('Cash Payments Module', function () {

/** @const */
Expand Down Expand Up @@ -67,16 +67,16 @@ describe('Cash Payments Module', function () {
// our target is cashboxA
var target = path.concat('/' + cashboxA.id);

// implicitly choose cashbox A by navigating to it directly
// implicitly choose cashbox A by navigating to it directly
browser.get(target);

// make sure all $http/$timeout requests clear before moving forward
browser.waitForAngular();
expect(getCurrentPath()).to.eventually.equal(target);
browser.waitForAngular();

expect(getCurrentPath()).to.eventually.equal(target);

// attempt to return to /cash manually
browser.get(path);
browser.get(path);

// expect that we were routed back to cashbox A
expect(getCurrentPath()).to.eventually.equal(target);
Expand All @@ -90,15 +90,15 @@ describe('Cash Payments Module', function () {
// emulate a selection by simply going to the direct URL
// this should set the cashbox ID in localstorage
browser.get(target);

// make sure all $http/$timeout requests clear before moving forward
browser.waitForAngular();

// confirm that we actually go to the page
expect(getCurrentPath()).to.eventually.equal(target);

// attempt to return to the cash page manually
browser.get(path);
browser.get(path);

// the browser should be rerouted to the cashboxB page
expect(getCurrentPath()).to.eventually.equal(target);
Expand Down Expand Up @@ -151,16 +151,16 @@ describe('Cash Payments Module', function () {

// This caution payment should succeed
var mockCautionPayment = {
patientName: 'Test 1',
patientName: 'Test 2',
amount : 150
};

// This payment against patient invoices should succeed
var mockInvoicesPayment = {
patientId: 'TPA2',
patientId: 'TPA1',
date : new Date('2016-03-01'),
amount : 5.12
};
};

it('should make a caution payment', function () {

Expand Down Expand Up @@ -228,10 +228,10 @@ describe('Cash Payments Module', function () {

// expect the receipt modal to appear
FU.exists(by.css('[data-cash-receipt-modal]'), true);
});
});
});

describe('Cash Transfer ', function (){
describe('Cash Transfer ', function (){

/** navigate to the page before each function */
beforeEach(function () {
Expand All @@ -253,7 +253,7 @@ describe('Cash Payments Module', function () {
var CDFRadio = element(by.css('[data-transfer-currency-option="1"]'));
CDFRadio.click();

//set a value in the currency component by model to avoid conflict
//set a value in the currency component by model to avoid conflict
components.currencyInput.set(mockTransfer.amount, 'transferCurrencyInput');

// submit the modal button
Expand Down

0 comments on commit a12d1db

Please sign in to comment.