Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 1. What are smoke tests?
- Smoke tests are simple tests that make sure the component will run in production.
- 2. When would you choose to use shallow and full-DOM rendering?
- You would use shallow rendering for testing the parent component. No child components are tested.
- You would use full DOM rendering when you want to test both the parent and child components.
- 3. Imagine you could only test one of your actions, or your reducers. Which would you choose and why?
- I would test my authentication action and reducer.
- 4. What does the exact prop of the Route component do?
- The exact prop only goes to that exact route, and not any child routes
- 5. Explain this syntax in the context of an async action: const actionName = () => dispatch => {
- Returns a callback function.
- 6. What conditions should you check to make sure that a user is providing valid registration information?
- If the username is already used, if the passwords match, if the password length is long enough, if the required fields are
- filled.
- Which of these can be checked on the frontend?
- If the passwords match, if the password length is long enough, if the required fields are
- filled.
- 7. Which header do you need to set to provide a JWT token as credentials to an endpoint?
- Authorization
- What should the header value look like.
- Authorization: `Bearer ${authToken}`
- 8. What is the purpose of refreshing a JWT, and when do we do it?
- A JWT token is only good for a certain amount of time. Refreshing a JWT every once in a while while a user is logged in keeps
- it from logging the user out while they are in the app.
Add Comment
Please, Sign In to add comment