2019-04-02 14:06:44 +02:00
|
|
|
import React from 'react';
|
|
|
|
import { mount, shallow } from 'enzyme';
|
|
|
|
|
|
|
|
import Initializer from '../index';
|
|
|
|
|
|
|
|
describe('<Initializer />', () => {
|
|
|
|
it('Should not crash', () => {
|
|
|
|
const updatePlugin = jest.fn();
|
2020-02-12 21:55:56 +01:00
|
|
|
const renderedComponent = shallow(
|
|
|
|
<Initializer updatePlugin={updatePlugin} />
|
|
|
|
);
|
2019-04-02 14:06:44 +02:00
|
|
|
|
|
|
|
expect(renderedComponent.children()).toHaveLength(0);
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should call the updatePlugin props when mounted', () => {
|
|
|
|
const updatePlugin = jest.fn();
|
|
|
|
|
|
|
|
const wrapper = mount(<Initializer updatePlugin={updatePlugin} />);
|
|
|
|
|
2020-02-12 21:55:56 +01:00
|
|
|
expect(wrapper.prop('updatePlugin')).toHaveBeenCalledWith(
|
|
|
|
'upload',
|
|
|
|
'isReady',
|
|
|
|
true
|
|
|
|
);
|
2019-04-02 14:06:44 +02:00
|
|
|
});
|
|
|
|
});
|