mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-11-11 18:32:20 +08:00
6c00098861
- Typo in cjsx code broke the message timestamp - Converted to es6 so this doesn't happen again!
20 lines
694 B
CoffeeScript
20 lines
694 B
CoffeeScript
moment = require 'moment'
|
|
React = require "react"
|
|
ReactDOM = require "react-dom"
|
|
ReactTestUtils = require 'react-addons-test-utils'
|
|
MessageTimestamp = require('../lib/message-timestamp').default
|
|
|
|
msgTime = ->
|
|
moment([2010, 1, 14, 15, 25, 50, 125]) # Feb 14, 2010 at 3:25 PM
|
|
|
|
describe "MessageTimestamp", ->
|
|
beforeEach ->
|
|
@item = ReactTestUtils.renderIntoDocument(
|
|
<MessageTimestamp date={msgTime()} />
|
|
)
|
|
|
|
it "still processes one day, even if it crosses a month divider", ->
|
|
# this should be tested in moment.js, but we add a test here for our own sanity too
|
|
feb28 = moment([2015, 1, 28])
|
|
mar01 = moment([2015, 2, 1])
|
|
expect(mar01.diff(feb28, 'days')).toBe 1
|