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

add patient admitted test. #993

Merged
merged 1 commit into from
Mar 20, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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('patient', function() {
authenticateUser();
visit('/patients/admitted');
andThen(function() {
assert.equal(currentURL(), '/patients/admitted');
assert.equal(find('.clickable').length, 1, 'One patient is listed');
});

click('button:contains(Discharge)');
waitToAppear('.view-current-title:contains(Edit Visit)');
andThen(function() {
assert.equal(currentURL(), '/visits/edit/03C7BF8B-04E0-DD9E-9469-96A5604F5340', 'should return visits/edit instead');
});
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)');
visit('/patients/admitted');
waitToAppear('.view-current-title:contains(Admitted Patients)');
andThen(() => {
assert.equal(find('.clickable').length, 0, 'No patient is listed');
});
});
});

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