maxs15 / react-native-modalbox

A <Modal/> component for react-native
MIT License
2.9k stars 504 forks source link

onOpened is not called when testing environment #317

Closed mym0404 closed 4 years ago

mym0404 commented 4 years ago

Description I am using jest test runner. It seems to onOpened, onClosed callback is not called during the test but invoked in the launched application.

I can resolve this issue with

Modal.prototype.open = function (){
  this.props.onOpened?.();
};
Modal.prototype.close = function (){
  this.props.onClosed?.();
};

in test environment set up process.


Library version 2.0.0


Info

System:
    OS: macOS 10.15.3
    CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
    Memory: 4.07 GB / 16.00 GB
    Shell: 5.7.1 - /bin/zsh
  Binaries:
    Node: 13.7.0 - /usr/local/bin/node
    Yarn: 1.22.0 - /usr/local/bin/yarn
    npm: 6.14.1 - /usr/local/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  Managers:
    CocoaPods: 1.9.1 - /Users/mj/.rvm/gems/ruby-2.7.0/bin/pod
  SDKs:
    iOS SDK:
      Platforms: iOS 13.4, DriverKit 19.0, macOS 10.15, tvOS 13.4, watchOS 6.2
    Android SDK:
      API Levels: 28
      Build Tools: 24.0.1, 25.0.0, 25.0.2, 26.0.2, 27.0.2, 27.0.3, 28.0.0, 28.0.2, 28.0.3, 29.0.1, 29.0.2
      System Images: android-29 | Google APIs Intel x86 Atom, android-29 | Google Play Intel x86 Atom_64
      Android NDK: 21.0.6113669
  IDEs:
    Android Studio: 3.6 AI-192.7142.36.36.6392135
    Xcode: 11.4.1/11E503a - /usr/bin/xcodebuild
  Languages:
    Java: 1.8.0_192 - /usr/bin/javac
    Python: 2.7.16 - /usr/bin/python
  npmPackages:
    @react-native-community/cli: Not Found
    react: 16.11.0 => 16.11.0 
    react-native: ^0.62.2 => 0.62.2 
  npmGlobalPackages:
    *react-native*: Not Found