-
Notifications
You must be signed in to change notification settings - Fork 274
feature: basic example app #1025
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
Conversation
// for the action to complete. | ||
// Hint: subsequent queries do not need to use `findBy`, because they are used after the async action | ||
// already finished | ||
expect(await screen.findByText('Welcome admin!')).toBeTruthy(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's no need to expect everything, right? This reads better as a scenario to me:
expect(await screen.findByText('Welcome admin!')).toBeTruthy(); | |
await screen.findByText('Welcome admin!')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah thats a good question, I'used that in a similar pattern as we suggest using expect(getByText()).toBeTruthy()
to clarify the intent, despite the fact that simple getByText
would do the same.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! For the ease of maintenance I'd strongly consider not committing the "android" and "ios" folders (we could generate those with init
on demand) or use Expo
Co-authored-by: Michał Pierzchała <thymikee@gmail.com>
I've migrated the example to use Expo managed. |
Summary
Basic modern example for using RNTL. The app is generated from RN CLI template so there is some iOS/Android boilerplate but the benefit here is that we work on a real RN app and not an empty shell of it.
I also plan to use it as a base for refresh of other example apps.
Test plan
All checks and tests pass.