fix(spec): fix DST related spec failure & linter error

This commit is contained in:
Evan Morikawa 2016-11-05 11:56:23 -07:00
parent 02cfbd7878
commit b102b39037
2 changed files with 5 additions and 5 deletions

View file

@ -24,14 +24,14 @@ describe('Snooze Utils', function snoozeUtils() {
describe('when less than 24 hours from now', () => {
it('returns correct message if snoozeDate is on the hour of the clock', () => {
const now9AM = moment().hour(9).minute(0)
const now9AM = window.testNowMoment().hour(9).minute(0)
const tomorrowAt8 = moment(now9AM).add(1, 'day').hour(8)
const result = SnoozeUtils.snoozedUntilMessage(tomorrowAt8, now9AM)
expect(result).toEqual('Snoozed until 8 AM')
});
it('returns correct message if snoozeDate otherwise', () => {
const now9AM = moment().hour(9).minute(0)
const now9AM = window.testNowMoment().hour(9).minute(0)
const snooze10AM = moment(now9AM).hour(10).minute(5)
const result = SnoozeUtils.snoozedUntilMessage(snooze10AM, now9AM)
expect(result).toEqual('Snoozed until 10:05 AM')
@ -41,7 +41,7 @@ describe('Snooze Utils', function snoozeUtils() {
describe('when more than 24 hourse from now', () => {
it('returns correct message if snoozeDate is on the hour of the clock', () => {
// Jan 1
const now9AM = moment().month(0).date(1).hour(9).minute(0)
const now9AM = window.testNowMoment().month(0).date(1).hour(9).minute(0)
const tomorrowAt10 = moment(now9AM).add(1, 'day').hour(10)
const result = SnoozeUtils.snoozedUntilMessage(tomorrowAt10, now9AM)
expect(result).toEqual('Snoozed until Jan 2, 10 AM')
@ -49,7 +49,7 @@ describe('Snooze Utils', function snoozeUtils() {
it('returns correct message if snoozeDate otherwise', () => {
// Jan 1
const now9AM = moment().month(0).date(1).hour(9).minute(0)
const now9AM = window.testNowMoment().month(0).date(1).hour(9).minute(0)
const tomorrowAt930 = moment(now9AM).add(1, 'day').minute(30)
const result = SnoozeUtils.snoozedUntilMessage(tomorrowAt930, now9AM)
expect(result).toEqual('Snoozed until Jan 2, 9:30 AM')

View file

@ -77,7 +77,7 @@ class TaskQueue
NylasEnv.onBeforeUnload((finishUnload) =>
if @_savedOnUnload then return true
@_saveQueue()
.finally(() =>
.finally(=>
@_savedOnUnload = true
finishUnload()
)