Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test cases failing after upgrading to RN version 0.78 #50165

Open
vinvijdev opened this issue Mar 20, 2025 · 4 comments
Open

Test cases failing after upgrading to RN version 0.78 #50165

vinvijdev opened this issue Mar 20, 2025 · 4 comments
Labels
Needs: Author Feedback Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. Newer Patch Available

Comments

@vinvijdev
Copy link

Description

Upgraded React Native version from 0.73.6 to 0.78.0 post which test cases are failing without any code change in test suite or the screen. Views which are invisible are returning element.not.toBeOnTheScreen() as false.

Steps to reproduce

  1. Clone https://github.com/vinvijdev/IssueReproducer
  2. Run yarn test update-profile-screen

React Native Version

0.78.0

Affected Platforms

Build - MacOS

Output of npx @react-native-community/cli info

System:
  OS: macOS 15.3.1
  CPU: (10) arm64 Apple M1 Pro
  Memory: 122.17 MB / 16.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 18.18.0
    path: ~/.nvm/versions/node/v18.18.0/bin/node
  Yarn:
    version: 1.22.22
    path: ~/.nvm/versions/node/v18.18.0/bin/yarn
  npm:
    version: 9.8.1
    path: ~/.nvm/versions/node/v18.18.0/bin/npm
  Watchman:
    version: 2024.05.06.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.16.2
    path: /Users/I583816/.gem/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 24.2
      - iOS 18.2
      - macOS 15.2
      - tvOS 18.2
      - visionOS 2.2
      - watchOS 11.2
  Android SDK:
    API Levels:
      - "28"
      - "30"
      - "31"
      - "32"
      - "33"
      - "33"
      - "34"
      - "35"
    Build Tools:
      - 28.0.3
      - 29.0.2
      - 30.0.3
      - 31.0.0
      - 32.0.0
      - 33.0.0
      - 33.0.1
      - 33.0.2
      - 34.0.0
      - 34.0.0
      - 34.0.0
      - 35.0.0
    System Images:
      - android-29 | Google Play ARM 64 v8a
      - android-30 | Google APIs ARM 64 v8a
      - android-31 | Google APIs ARM 64 v8a
      - android-31 | Google Play ARM 64 v8a
      - android-33 | Google APIs ARM 64 v8a
      - android-34 | Google Play ARM 64 v8a
      - android-35 | Google APIs ARM 64 v8a
    Android NDK: Not Found
IDEs:
  Android Studio: 2022.3 AI-223.8836.35.2231.11005911
  Xcode:
    version: 16.2/16C5032a
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.9
    path: /Users/I583816/Library/Java/JavaVirtualMachines/corretto-17.0.9/Contents/Home/bin/javac
  Ruby:
    version: 3.1.1
    path: /Users/I583816/.asdf/shims/ruby
npmPackages:
  "@react-native-community/cli":
    installed: 15.0.1
    wanted: 15.0.1
  react:
    installed: 19.0.0
    wanted: 19.0.0
  react-native:
    installed: 0.78.0
    wanted: 0.78.0
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: true
iOS:
  hermesEnabled: true
  newArchEnabled: false

Stacktrace or Logs

FAIL  src/screens/update-profile/update-profile-screen.test.tsx (20.309 s)
  ● Should display the UpdateProfileAlert when pressing cancel, since changes to the name were made. Dismiss first, then discard

    expect(element).not.toBeOnTheScreen()

    expected element tree not to contain element, but found
      <View
        accessibilityLabel="Schließen"
        accessibilityRole="button"
        accessible={true}
        testID="unknown:id/updateProfile_headline_closeButton"
      />

      42 |   )
      43 |
    > 44 |   expect(screen.queryByTestId(buildTestId('updateProfile_headline_closeButton'))).not.toBeOnTheScreen()
         |                                                                                       ^
      45 |   expect(screen.queryByTestId(buildTestId('updateProfile_headline_backButton'))).toBeOnTheScreen()
      46 |
      47 |   let emailInput = await screen.findByTestId(buildTestId('updateProfile_email_input'))

      at Object.toBeOnTheScreen (src/screens/update-profile/update-profile-screen.test.tsx:44:87)
      at asyncGeneratorStep (node_modules/@babel/runtime/helpers/asyncToGenerator.js:3:17)
      at _next (node_modules/@babel/runtime/helpers/asyncToGenerator.js:17:9)
      at node_modules/@babel/runtime/helpers/asyncToGenerator.js:22:7
      at Object.<anonymous> (node_modules/@babel/runtime/helpers/asyncToGenerator.js:14:12)

Reproducer

https://github.com/vinvijdev/IssueReproducer

Screenshots and Videos

Image
@vinvijdev vinvijdev changed the title Test cases failing upgrading to RN version 0.78 Test cases failing after upgrading to RN version 0.78 Mar 20, 2025
@react-native-bot
Copy link
Collaborator

Tip

Newer version available: You are on a supported minor version, but it looks like there's a newer patch available - 0.78.1. Please upgrade to the highest patch for your minor or latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If it does not repro, please let us know so we can close out this issue. This helps us ensure we are looking at issues that still exist in the most recent releases.

@react-native-bot
Copy link
Collaborator

Tip

Newer version available: You are on a supported minor version, but it looks like there's a newer patch available - undefined. Please upgrade to the highest patch for your minor or latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If it does not repro, please let us know so we can close out this issue. This helps us ensure we are looking at issues that still exist in the most recent releases.

@cortinico
Copy link
Contributor

Upgraded React Native version from 0.73.6 to 0.78.0 post which test cases are failing without any code change in test suite or the screen. Views which are invisible are returning element.not.toBeOnTheScreen() as false.

We can't really fix your tests sorry. You bumped 5 minor versions of React Native. Between those there is also the migration to New Architecture (0.76).

The reproducer you provided is also huge, we can't really help with that.

Please come back with a smaller reproducer (a single test, a single screen, no dependency).
You can use this template: https://github.com/react-native-community/reproducer-react-native

@cortinico cortinico added Needs: Author Feedback Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. labels Mar 21, 2025
@react-native-bot
Copy link
Collaborator

Warning

Missing reproducer: We could not detect a reproducible example in your issue report. Please provide either:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs: Author Feedback Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. Newer Patch Available
Projects
None yet
Development

No branches or pull requests

3 participants