Skip to content
This repository has been archived by the owner on Jul 5, 2021. It is now read-only.

Create 404 page #7

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open

Conversation

HigorSegobia
Copy link

Pull request related to issue #422 Add 404 page
Some images of how the final result was both on the web and mobile.
Captura de Tela 2020-09-16 às 12 17 45
Captura de Tela 2020-09-16 às 12 18 06

Copy link
Member

@guidiego guidiego left a comment

Choose a reason for hiding this comment

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

Thank you for your PR @HigorSegobia. I left some comments that need to be solved before get a merge! Let me know if you have any questions.

OBS: You need to add tests for another components too.

src/components/BackgroundParticles/index.tsx Outdated Show resolved Hide resolved
src/components/BackgroundParticles/index.tsx Outdated Show resolved Hide resolved
src/components/PageError/index.tsx Outdated Show resolved Hide resolved
src/pages/404.tsx Outdated Show resolved Hide resolved
it('should render component properly', () => {
const wrap = shallow(<PageError code="foo" message="bar" description="test" />);

expect(wrap).toBeCalled;
Copy link
Member

Choose a reason for hiding this comment

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

Check the test from other components! You need to check if Page renders the components correctly!

Copy link
Member

Choose a reason for hiding this comment

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

Same from before!

@guidiego guidiego added the enhancement New feature or request label Sep 17, 2020
@guidiego guidiego self-requested a review September 30, 2020 19:50

describe('components/BackgroundParticles', () => {
it('should render component properly', () => {
const wrap = shallow(<BackgroundParticles />);
Copy link
Member

Choose a reason for hiding this comment

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

You not test it properly!

You should chec toContainsElement en see if it calls Particle with correct arguments.

it('should render component properly', () => {
const wrap = shallow(<PageError code="foo" message="bar" description="test" />);

expect(wrap).toBeCalled;
Copy link
Member

Choose a reason for hiding this comment

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

Same from before!

Copy link
Member

@guidiego guidiego left a comment

Choose a reason for hiding this comment

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

Replicate the comments in other props to remove the "any" arguments, or hardcoded Record<string, string>

},
};

type Props = { classes: Record<string, string> };
Copy link
Member

Choose a reason for hiding this comment

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

I discover how to fix it and avoid it!

import { WithStyles } from '@material-ui/core/styles';

interface Props extends WithStyles<typeof BackgroundParticlesStyles> {
  // other props
}

import Particles, { IParticlesParams } from 'react-particles-js';
import { withStyles } from '@material-ui/core/styles';

const useStyles = withStyles((theme) => ({
Copy link
Member

Choose a reason for hiding this comment

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

I will need that you change it to:

const BackgroundParticlesStyles = (theme: Theme) => createStyles({ ... });
const useStyles = withStyles(BackgroundParticlesStyles);

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants