Skip to content
Snippets Groups Projects
Commit b88cb7b1 authored by Chris Beer's avatar Chris Beer
Browse files

Pass any additional props through MiradorView#props to the App component

parent 5e34a35a
No related branches found
No related tags found
No related merge requests found
import ReactDOM from 'react-dom';
import { shallow } from 'enzyme';
import MiradorViewer from '../../../src/lib/MiradorViewer';
jest.unmock('react-i18next');
......@@ -104,6 +105,15 @@ describe('MiradorViewer', () => {
}));
});
});
describe('render', () => {
it('passes props through to the App component', () => {
const rendered = shallow(instance.render({ some: 'prop' }));
expect(rendered.find('App').length).toBe(1);
expect(rendered.find('App').prop('some')).toBe('prop');
});
});
describe('unmount', () => {
it('unmounts via ReactDOM', () => {
instance.unmount();
......
......@@ -28,10 +28,10 @@ class MiradorViewer {
/**
* Render the mirador viewer
*/
render() {
render(props = {}) {
return (
<Provider store={this.store}>
<HotApp plugins={this.plugins} />
<HotApp plugins={this.plugins} {...props} />
</Provider>
);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment