-
Notifications
You must be signed in to change notification settings - Fork 3
Create 404 page #7
base: main
Are you sure you want to change the base?
Conversation
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.
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.
tests/components/PageError.spec.tsx
Outdated
it('should render component properly', () => { | ||
const wrap = shallow(<PageError code="foo" message="bar" description="test" />); | ||
|
||
expect(wrap).toBeCalled; |
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.
Check the test from other components! You need to check if Page renders the components correctly!
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.
Same from before!
|
||
describe('components/BackgroundParticles', () => { | ||
it('should render component properly', () => { | ||
const wrap = shallow(<BackgroundParticles />); |
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 not test it properly!
You should chec toContainsElement en see if it calls Particle with correct arguments.
tests/components/PageError.spec.tsx
Outdated
it('should render component properly', () => { | ||
const wrap = shallow(<PageError code="foo" message="bar" description="test" />); | ||
|
||
expect(wrap).toBeCalled; |
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.
Same from before!
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.
Replicate the comments in other props to remove the "any" arguments, or hardcoded Record<string, string>
}, | ||
}; | ||
|
||
type Props = { classes: Record<string, string> }; |
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 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) => ({ |
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 will need that you change it to:
const BackgroundParticlesStyles = (theme: Theme) => createStyles({ ... });
const useStyles = withStyles(BackgroundParticlesStyles);
Pull request related to issue #422 Add 404 page
Some images of how the final result was both on the web and mobile.