-
Notifications
You must be signed in to change notification settings - Fork 95
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
Mini challenge 5 #109
base: master
Are you sure you want to change the base?
Mini challenge 5 #109
Conversation
axelzo
commented
Aug 31, 2021
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.
Thanks for this final delivery. I think there are some missing functionality. I was not able to add a video to the favorite list. The favorite pages should display only the videos selected by the user and the related videos should be the rest of the videos on the favorites list. The tests that you added are really good, however, there is still some work to do to get the 70% coverage
<AuthProvider> | ||
<Layout> | ||
<Switch> | ||
<Route exact path="/favorites"> |
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.
This and the favorite details page should be private
<Route exact path="/login"> | ||
<LoginPage /> | ||
</Route> | ||
<Private exact path="/secret"> |
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.
I think the secret can be removed
|
||
import { StateContext } from '../../context/State/state'; | ||
|
||
const StyledMenu = styled.nav` |
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.
You can move the styled components to another file Menu.styled.js
and just import all the styles here
|
||
describe('Menu', () => { | ||
test('should render Home span', async () => { | ||
const spanLabel = screen.queryByText('HOME'); |
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.
const spanLabel = screen.queryByText('HOME'); | |
const spanLabel = screen.getByText('HOME'); |
query*
should be used only when we check for inexistent. See: https://kentcdodds.com/blog/common-mistakes-with-react-testing-library#using-query-variants-for-anything-except-checking-for-non-existence
const { handleSearch, darkMode } = stateContext; | ||
|
||
return ( | ||
<Container mode={darkMode ? 1 : 0}> |
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.
Instead of doing this on every component where you need it, you can create a function and export it. If something change, you just need to change it in one place. Also, as the var is boolean, a better proper name would be isDarkMode