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

Mini challenge 5 #109

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Conversation

axelzo
Copy link

@axelzo axelzo commented Aug 31, 2021

image

Copy link

@marrossa86 marrossa86 left a 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">

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">

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`

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');

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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}>

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

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