Skip to content

Commit

Permalink
Add failing tests for appointments after 23:00
Browse files Browse the repository at this point in the history
Add failing tests for appointments after 23:00

This sets the time to 23:40 so that the issues described in issue HospitalRun#976
are shown without setting the global system time

Does not resolve issue, only sets test for it
  • Loading branch information
mkly committed Mar 7, 2017
1 parent 6af3e2c commit 8fa9489
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/acceptance/appointments-test.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,30 @@
import Ember from 'ember';
import { module, test } from 'qunit';
import moment from 'moment';
import sinon from 'sinon';
import startApp from 'hospitalrun/tests/helpers/start-app';

const DATE_TIME_FORMAT = 'l h:mm A';
const TIME_FORMAT = 'h:mm';

const setIntervalNative = setInterval;
const clearIntervalNative = clearInterval;
let clock, interval;

module('Acceptance | appointments', {
beforeEach() {
clock = sinon.useFakeTimers(new Date(2017, 0, 1, 23, 40, 0).getTime());
interval = setIntervalNative(function() {
clock.tick(10);
}, 10);

this.application = startApp();
},

afterEach() {
Ember.run(this.application, 'destroy');
clock.restore();
clearIntervalNative(interval);
}
});

Expand Down

0 comments on commit 8fa9489

Please # to comment.