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

Unable to find MenuOption by testID #253

Open
plambir93kek opened this issue Sep 1, 2022 · 4 comments
Open

Unable to find MenuOption by testID #253

plambir93kek opened this issue Sep 1, 2022 · 4 comments

Comments

@plambir93kek
Copy link

Hi, i use Jest framework and RNTL for e2e testing, and i faced with the problem.
No MenuOption in snapshots, also unable to find MenuOption by testID after fireEvent.press(trigger).
Is there any way to have e2e tests with this library?

<MenuOption
      customStyles={{ optionTouchable: { testID: 'option' }}}
      disabled={isDisabled}
      value={value}
      onSelect={handleSelect}>
      {icon && <View style={[style.icon, iconStyle]}>{icon}</View>}
      <AppText style={titleStyle}>{title}</AppText>
    </MenuOption>
@pramahaditamaputra
Copy link

Hi @plambir93kek did you found any solution for this ? because i'm facing this the same issue right now

@sodik82
Copy link
Contributor

sodik82 commented Jan 17, 2023

just curious, what everything is under your test?

because MenuOptions are rendered inside MenuProvider component normally

@kkaplinski
Copy link

I'm facing the same issue. Even when I manually set opened={true}, there is no menu options in the snapshot. I render menu component inside Menu Provider in my tests.

@daves28
Copy link

daves28 commented Nov 27, 2024

This is still an issue. The MenuOptions component, and therefore all MenuOption components, do not appear in the screen.debug snapshot from @testing-library/react-native.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants