Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.

Commit

Permalink
add patient admitted test.
Browse files Browse the repository at this point in the history
  • Loading branch information
baoqchau committed Mar 17, 2017
1 parent 9550d52 commit ce37bc0
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions tests/acceptance/patients-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,35 @@ test('View reports tab | Patient Status', function(assert) {
});
});

test('Testing admitted patient', function(assert) {
runWithPouchDump('default', function() {
authenticateUser();
visit('/patients/admitted');
andThen(function() {
assert.equal(currentURL(), '/patients/admitted');
assert.equal(find('tr').length, 1, 'One patient is listed');
findWithAssert('button:contains(Edit)');
findWithAssert('button:contains(Discharge)');
findWithAssert('button:contains(Delete)');
});

click('button:contains(Discharge)');
andThen(() => {
assert.equal(currentURL(), '/visits/edit', 'Now in add visiting information route');
});
click('.panel-footer button:contains(Discharge)');
waitToAppear('.modal-dialog');
andThen(() => {
assert.equal(find('.modal-title').text(), 'Patient Discharged', 'Patient has been discharged');
});
click('button:contains(Ok)');
andThen(() => {
visit('/patients/admitted');
assert.equal(find('tr').length, 0, 'No patient is listed');
});
});
});

test('Adding a new patient record', function(assert) {
runWithPouchDump('default', function() {
authenticateUser();
Expand Down

0 comments on commit ce37bc0

Please sign in to comment.