2017-12-20 05:10:53 +01:00
|
|
|
/**
|
|
|
|
* LastSync component
|
|
|
|
*/
|
|
|
|
|
|
|
|
import React from 'react';
|
2018-07-21 20:49:10 +02:00
|
|
|
import { shallow } from 'enzyme';
|
2018-07-17 21:22:44 +02:00
|
|
|
import LastSync from '../../../../../src/webui/components/PackageSidebar/modules/LastSync/index';
|
2017-12-20 05:10:53 +01:00
|
|
|
|
2018-03-21 12:26:27 +01:00
|
|
|
describe('<PackageSidebar /> : <LastSync />', () => {
|
2018-12-05 19:30:08 +01:00
|
|
|
test('should check the default props condition', () => {
|
2018-12-15 00:23:30 +01:00
|
|
|
const wrapper = shallow(<LastSync />);
|
2018-07-21 20:49:10 +02:00
|
|
|
expect(wrapper.html()).toMatchSnapshot();
|
2017-12-20 05:10:53 +01:00
|
|
|
});
|
|
|
|
|
2018-12-05 19:30:08 +01:00
|
|
|
test('should load the LastSync component and match snapshot', () => {
|
2018-07-21 20:49:10 +02:00
|
|
|
const props = {
|
|
|
|
lastUpdated: '2017/12/14, 15:43:52',
|
|
|
|
recentReleases: [
|
|
|
|
{ time: '2017/12/14, 15:43:27', version: '2.7.1' },
|
|
|
|
{ time: '2017/12/05, 23:25:06', version: '2.7.0' },
|
|
|
|
{ time: '2017/11/08, 22:47:16', version: '2.6.6' }
|
|
|
|
]
|
|
|
|
};
|
2018-12-15 16:39:51 +01:00
|
|
|
const wrapper = shallow(<LastSync {...props} />);
|
2017-12-20 05:10:53 +01:00
|
|
|
expect(wrapper.html()).toMatchSnapshot();
|
|
|
|
});
|
|
|
|
});
|