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

add appointment today test #1012

Merged
merged 1 commit into from
Mar 22, 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
22 changes: 22 additions & 0 deletions tests/acceptance/appointments-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,28 @@ test('visiting /appointments/missed', function(assert) {
});
});

test('test appointment for today', function(assert) {
runWithPouchDump('appointments', function() {
authenticateUser();
visit('/appointments/today');
assert.equal(find('.appointment-date').length, 0, 'should have 0 appointment today');
visit('/appointments/edit/new');
andThen(function() {
assert.equal(currentURL(), '/appointments/edit/new');
findWithAssert('button:contains(Cancel)');
findWithAssert('button:contains(Add)');
});

createAppointment(assert);

visit('/appointments/today');
andThen(() => {
assert.equal(currentURL(), '/appointments/today');
assert.equal(find('.appointment-status').text(), 'Scheduled', 'should have 1 appointment today');
});
});
});

test('Creating a new appointment', function(assert) {
runWithPouchDump('appointments', function() {
authenticateUser();
Expand Down