diff --git a/jest/mockComponent.js b/jest/mockComponent.js index 3f98a160d..e94d467a6 100644 --- a/jest/mockComponent.js +++ b/jest/mockComponent.js @@ -48,9 +48,9 @@ module.exports = (moduleName, instanceMethods) => { } }; - if (RealComponent.propTypes != null) { - Component.propTypes = RealComponent.propTypes; - } + Object.keys(RealComponent).forEach(classStatic => { + Component[classStatic] = RealComponent[classStatic]; + }); if (instanceMethods != null) { Object.assign(Component.prototype, instanceMethods);