Fix tests

pull/10616/head
deniz kusefoglu 2017-10-26 14:35:03 -07:00
parent 4eb8f8945d
commit 1fabda0156
1 changed files with 4 additions and 1 deletions

View File

@ -3,13 +3,16 @@ import {
formatDate,
dashboardtoCSV,
} from 'shared/parsing/resultsToCSV'
import moment from 'moment'
describe('formatDate', () => {
it('converts timestamp to an excel compatible date string', () => {
const timestamp = 1000000000000
const result = formatDate(timestamp)
expect(result).to.be.a('string')
expect(+new Date(result)).to.equal(timestamp)
expect(moment(result, 'M/D/YYYY h:mm:ss.SSSSSSSSS A').valueOf()).to.equal(
timestamp
)
})
})