Skip to content

Commit

Permalink
feat: adding alex to the About component
Browse files Browse the repository at this point in the history
  • Loading branch information
adamos486 committed Mar 17, 2022
1 parent 3b79a50 commit f176f5e
Show file tree
Hide file tree
Showing 4 changed files with 109 additions and 42 deletions.
Binary file added src/assets/avatars/alexkerr.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
41 changes: 33 additions & 8 deletions src/components/home/ImageAvatars.test.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,35 @@
import React from 'react';
import { shallowRenderToMatchSnapshot } from '../../util/unitTests';
import React from "react";
import {shallowRenderToMatchSnapshot} from "../../util/unitTests";

import ImageAvatars from './ImageAvatars';
import ImageAvatars from "./ImageAvatars";
import {render, screen} from "@testing-library/react";

describe('<ImageAvatars>', () => {
it('renders correctly', () => {
shallowRenderToMatchSnapshot(<ImageAvatars />);
});
});
describe("<ImageAvatars>", () => {
it("renders correctly", () => {
shallowRenderToMatchSnapshot(<ImageAvatars />);
});

it("displays rocio name and photo and title", () => {
render(<ImageAvatars />);

expect(screen.getByText("Rocio Ng")).toBeVisible();
expect(screen.getByAltText("Rocio")).toHaveAttribute("src", "rocio.jpg");
expect(screen.getByText("Project Lead")).toBeVisible();
});

it("displays emilys name and photo and title", () => {
render(<ImageAvatars />);

expect(screen.getByText("Emily Kasa")).toBeVisible();
expect(screen.getByAltText("Emily")).toHaveAttribute("src", "emily.jpg");
expect(screen.getByText("Data Jam Lead")).toBeVisible();
});

it("displays alexs name and photo and title", () => {
render(<ImageAvatars />);

expect(screen.getByAltText("Alex")).toHaveAttribute("src", "alexkerr.jpg");
expect(screen.getByText("Alex Kerr")).toBeVisible();
expect(screen.getByText("Engineer")).toBeVisible();
});
});
85 changes: 51 additions & 34 deletions src/components/home/ImageAvatars.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
import React from 'react';
import { makeStyles } from '@material-ui/core/styles';
import Avatar from '@material-ui/core/Avatar';
import Grid from '@material-ui/core/Grid';
import Typography from '@material-ui/core/Typography';
import Box from '@material-ui/core/Box';
import React from "react";
import {makeStyles} from "@material-ui/core/styles";
import Avatar from "@material-ui/core/Avatar";
import Grid from "@material-ui/core/Grid";
import Typography from "@material-ui/core/Typography";
import Box from "@material-ui/core/Box";

import rocio from '../../assets/avatars/rocio.jpg';
import emily from '../../assets/avatars/emily.jpg';
import rocio from "../../assets/avatars/rocio.jpg";
import emily from "../../assets/avatars/emily.jpg";
import alex from "../../assets/avatars/alexkerr.jpg";

const useStyles = makeStyles((theme) => ({
root: {
display: 'flex',
'& > *': {
display: "flex",
"& > *": {
margin: theme.spacing(1),
},
},
Expand All @@ -27,30 +28,46 @@ export default function ImageAvatars() {
return (
<Box component="section" mt={8} mb={8}>
<Typography variant="h3">Meet the Team</Typography>
<div className={classes.root}>
<Grid container spacing={2}>
<Grid item xs={6}>
<Box display="flex"
flexDirection="column"
alignItems="center"
justifyContent="center">
<Avatar alt="Rocio" src={rocio} className={classes.large} />
<Typography>Rocio Ng</Typography>
<Typography variant="body2">Project Lead</Typography>
</Box>
<div className={classes.root}>
<Grid container spacing={2}>
<Grid item xs={6}>
<Box
display="flex"
flexDirection="column"
alignItems="center"
justifyContent="center"
>
<Avatar alt="Rocio" src={rocio} className={classes.large} />
<Typography>Rocio Ng</Typography>
<Typography variant="body2">Project Lead</Typography>
</Box>
</Grid>
<Grid item xs={6}>
<Box
display="flex"
flexDirection="column"
alignItems="center"
justifyContent="center"
>
<Avatar alt="Emily" src={emily} className={classes.large} />
<Typography>Emily Kasa</Typography>
<Typography variant="body2">Data Jam Lead</Typography>
</Box>
</Grid>
<Grid item xs={6}>
<Box
display="flex"
flexDirection="column"
alignItems="center"
justifyContent="center"
>
<Avatar alt="Alex" src={alex} className={classes.large}/>
<Typography>Alex Kerr</Typography>
<Typography variant="body2">Engineer</Typography>
</Box>
</Grid>
</Grid>
<Grid item xs={6}>
<Box display="flex"
flexDirection="column"
alignItems="center"
justifyContent="center">
<Avatar alt="Emily" src={emily} className={classes.large} />
<Typography>Emily Kasa</Typography>
<Typography variant="body2">Data Jam Lead</Typography>
</Box>
</Grid>
</Grid>
</div>
</div>
</Box>
);
}
}
25 changes: 25 additions & 0 deletions src/components/home/__snapshots__/ImageAvatars.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,31 @@ exports[`<ImageAvatars> renders correctly 1`] = `
</WithStyles(ForwardRef(Typography))>
</Styled(MuiBox)>
</WithStyles(ForwardRef(Grid))>
<WithStyles(ForwardRef(Grid))
item={true}
xs={6}
>
<Styled(MuiBox)
alignItems="center"
display="flex"
flexDirection="column"
justifyContent="center"
>
<WithStyles(ForwardRef(Avatar))
alt="Alex"
className="makeStyles-large-2"
src="alexkerr.jpg"
/>
<WithStyles(ForwardRef(Typography))>
Alex Kerr
</WithStyles(ForwardRef(Typography))>
<WithStyles(ForwardRef(Typography))
variant="body2"
>
Engineer
</WithStyles(ForwardRef(Typography))>
</Styled(MuiBox)>
</WithStyles(ForwardRef(Grid))>
</WithStyles(ForwardRef(Grid))>
</div>
</Styled(MuiBox)>
Expand Down

0 comments on commit f176f5e

Please sign in to comment.