diff --git a/src/components/CloudinaryComponent/CloudinaryComponent.js b/src/components/CloudinaryComponent/CloudinaryComponent.js index a328d69..fedb4d7 100644 --- a/src/components/CloudinaryComponent/CloudinaryComponent.js +++ b/src/components/CloudinaryComponent/CloudinaryComponent.js @@ -29,7 +29,7 @@ class CloudinaryComponent extends Component { if (child.type && child.type.exposesProps){ options = CloudinaryComponent.normalizeOptions(child.props, child.context); } - let childOptions = this.getChildTransformations(child.props.children); + let childOptions = child.props && this.getChildTransformations(child.props.children); if(childOptions !== undefined && childOptions !== null){ options.transformation = childOptions; } diff --git a/test/VideoTest.js b/test/VideoTest.js index 5794b6b..4205e50 100644 --- a/test/VideoTest.js +++ b/test/VideoTest.js @@ -34,4 +34,13 @@ describe('Video', () => { expect(tag.find('[type="video/webm"]').props().src).to.endWith('/q_70/l_text:verdana_30:webm!/dog.webm'); expect(tag.find('[type="video/mp4"]').props().src).to.endWith('/q_70/l_text:verdana_30:mp4!/dog.mp4'); }); + + it('should support inner text', function () { + let tag = shallow( + + ); + expect(tag.type()).to.equal("video"); + }); }); \ No newline at end of file