mirror of
https://github.com/strapi/strapi.git
synced 2025-08-09 01:07:27 +00:00

Created OLD folder. Fix load plugin when no Initializer is provided. Signed-off-by: soupette <cyril.lpz@gmail.com>
28 lines
671 B
JavaScript
28 lines
671 B
JavaScript
import React from 'react';
|
|
import { mount, shallow } from 'enzyme';
|
|
|
|
import Initializer from '../index';
|
|
|
|
describe('<Initializer />', () => {
|
|
it('Should not crash', () => {
|
|
const updatePlugin = jest.fn();
|
|
const renderedComponent = shallow(
|
|
<Initializer updatePlugin={updatePlugin} />
|
|
);
|
|
|
|
expect(renderedComponent.children()).toHaveLength(0);
|
|
});
|
|
|
|
it('should call the updatePlugin props when mounted', () => {
|
|
const updatePlugin = jest.fn();
|
|
|
|
const wrapper = mount(<Initializer updatePlugin={updatePlugin} />);
|
|
|
|
expect(wrapper.prop('updatePlugin')).toHaveBeenCalledWith(
|
|
'upload',
|
|
'isReady',
|
|
true
|
|
);
|
|
});
|
|
});
|