import React from 'react' import { CrowdsaleEndTime } from '../../../src/components/Common/CrowdsaleEndTime' import { Form } from 'react-final-form' import Adapter from 'enzyme-adapter-react-15' import { configure, mount } from 'enzyme' import renderer from 'react-test-renderer' import { VALIDATION_MESSAGES, TEXT_FIELDS, DESCRIPTION } from '../../../src/utils/constants' import MockDate from 'mockdate' configure({ adapter: new Adapter() }) const DECRIPTION = DESCRIPTION.END_TIME const LABEL = TEXT_FIELDS.END_TIME describe('CrowdsaleEndTime', () => { const TIMESTAMPS = { CURRENT_TIME: 1520852400000, PLUS_5_MINUTES: 1520852700000, PLUS_10_MINUTES: 1520853000000, PLUS_10_DAYS: 1521716400000, MINUS_5_MINUTES: 1520852100000, MINUS_10_DAYS: 1519988400000 } const crowdsale = { tiers: [{ startTime: 0, endTime: 0 }] } beforeEach(() => { MockDate.set(TIMESTAMPS.CURRENT_TIME) crowdsale.tiers[0].startTime = TIMESTAMPS.PLUS_10_MINUTES crowdsale.tiers[0].endTime = TIMESTAMPS.PLUS_10_DAYS }) afterEach(() => { MockDate.reset() crowdsale.tiers[0].startTime = 0 crowdsale.tiers[0].endTime = 0 }) describe('Rendering', () => { it(`should render CrowdsaleEndTime component`, () => { const wrapper = renderer.create(