Revision 89b8fc37
Added by Amir Fefer over 4 years ago
webpack/assets/javascripts/react_app/components/common/DateTimePicker/DateComponents/DecadeView.test.js | ||
---|---|---|
import React from 'react';
|
||
import { shallow, mount } from 'enzyme';
|
||
import toJson from 'enzyme-to-json';
|
||
import { shallow, mount } from '@theforeman/test';
|
||
import DecadeView from './DecadeView';
|
||
|
||
test('DecadeView is working properly', () => {
|
||
const date = new Date('1/1/2020 , 2:22:31 PM');
|
||
const component = shallow(<DecadeView date={date} />);
|
||
|
||
expect(toJson(component.render())).toMatchSnapshot();
|
||
expect(component.render()).toMatchSnapshot();
|
||
});
|
||
|
||
test('Edit year DecadeView', () => {
|
||
const date = new Date('2/21/2019 , 2:22:31 PM');
|
||
const setSelected = jest.fn();
|
||
const component = mount(<DecadeView date={date} setSelected={setSelected} />);
|
||
expect(toJson(component.render())).toMatchSnapshot();
|
||
expect(component.render()).toMatchSnapshot();
|
||
component
|
||
.find('.year')
|
||
.first()
|
||
... | ... | |
const date = new Date('2/21/2019 , 2:22:31 PM');
|
||
const setSelected = jest.fn();
|
||
const component = mount(<DecadeView date={date} setSelected={setSelected} />);
|
||
expect(toJson(component.render())).toMatchSnapshot();
|
||
expect(component.render()).toMatchSnapshot();
|
||
component
|
||
.find('.next')
|
||
.first()
|
Also available in: Unified diff
Fixes #28488 - consume jest config from env