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

More examples and documentation for Testing with Jest #1152

Open
loekTheDreamer opened this issue May 31, 2022 · 0 comments
Open

More examples and documentation for Testing with Jest #1152

loekTheDreamer opened this issue May 31, 2022 · 0 comments

Comments

@loekTheDreamer
Copy link

loekTheDreamer commented May 31, 2022

Couldn't find a route object. Is your component inside a screen in a navigator?

      15 |   const {
      16 |     params: {title},
    > 17 |   } = useRoute<RouteProp<RootStackParamList, typeof SMART_CONTRACT_DETAILS>>();
         |       ^
      18 |
      19 |   const {errors, handleBlur, handleChange, handleSubmit, touched, values} =
      20 |     useForm(submit);

This error doesn't help me solve anything. i have added the navigator like it has suggested.

describe('<SmartContractDetails />', () => {
  it('should render as expected', () => {
   render(
      <NavigationContainer>
        <SmartContractDetails />
      </NavigationContainer>,
    );
  });
});

Please can you add some actual examples of how to test features. like passing params and using the navigator.

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

1 participant