-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Making tests for the validate application and the fetch company appli…
…cation services Making tests for the validate application and the fetch company application services
- Loading branch information
1 parent
95794d0
commit 3337414
Showing
13 changed files
with
252 additions
and
143 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,37 @@ | ||
import {Alert as MUI_Alert, AlertTitle} from "@material-ui/lab"; | ||
import {makeStyles} from "@material-ui/core"; | ||
|
||
import { Alert as MUIAlert, AlertTitle } from "@material-ui/lab"; | ||
import { makeStyles } from "@material-ui/core"; | ||
import PropTypes from "prop-types"; | ||
import { Warning as WarningIcon } from "@material-ui/icons"; | ||
import React from 'react'; | ||
import React from "react"; | ||
|
||
const useStyles = (props) => makeStyles((theme) => ({ | ||
const useStyles = (props) => makeStyles(() => ({ | ||
|
||
content:{ | ||
fontSize: props.fontSize+"em", | ||
content: { | ||
fontSize: `${props.fontSize}em`, | ||
"& .MuiAlert-icon": { | ||
fontSize: (props.fontSize+0.3)+"em" | ||
fontSize: `${props.fontSize + 0.3}em`, | ||
}, | ||
margin:"0.5em 0em" | ||
margin: "0.5em 0em", | ||
}, | ||
})); | ||
|
||
export const Alert = ({type, title, fontSize = 1, children}) => { | ||
const classes = useStyles({fontSize: fontSize})(); | ||
export const Alert = ({ type, title, fontSize = 1, children }) => { | ||
const classes = useStyles({ fontSize: fontSize })(); | ||
return ( | ||
<MUI_Alert severity={type} className={classes.content} icon={<WarningIcon />} data-testid="Alert"> | ||
{title ? <AlertTitle>{title}</AlertTitle> : null} | ||
<MUIAlert severity={type} className={classes.content} icon={<WarningIcon />} data-testid="Alert"> | ||
{title ? | ||
<AlertTitle> | ||
{title} | ||
</AlertTitle> : null} | ||
{children} | ||
</MUI_Alert> | ||
) | ||
} | ||
</MUIAlert> | ||
); | ||
}; | ||
|
||
Alert.propTypes = { | ||
type: PropTypes.oneOf(["error", "warning", "info", "success"]), | ||
title: PropTypes.string, | ||
children: PropTypes.string, | ||
fontSize: PropTypes.number, | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,10 @@ | ||
/* eslint-disable react/jsx-indent */ | ||
/* eslint-disable react/jsx-closing-tag-location */ | ||
/* eslint-disable indent */ | ||
import React, { useEffect, useState } from "react"; | ||
import {CardContent, CircularProgress, makeStyles, Button, Link, Typography} from "@material-ui/core"; | ||
import { CardContent, CircularProgress, makeStyles, Button, Link, Typography } from "@material-ui/core"; | ||
import { useMobile } from "../utils/media-queries"; | ||
import { useParams } from "react-router-dom"; | ||
import { validateApplication } from "../services/companyApplicationService"; | ||
import { getValidationMessage } from "../components/Apply/Company/CompanyApplicationUtils.js"; | ||
import {RouterLink} from "../utils"; | ||
import { RouterLink } from "../utils"; | ||
|
||
const useStyles = (isMobile) => makeStyles((theme) => ({ | ||
content: { | ||
|
@@ -16,10 +13,10 @@ const useStyles = (isMobile) => makeStyles((theme) => ({ | |
flexDirection: "column", | ||
alignItems: "center", | ||
justifyContent: "center", | ||
gap:"1em", | ||
gap: "1em", | ||
}, | ||
title: { | ||
fontWeight:500, | ||
fontWeight: 500, | ||
}, | ||
text: { | ||
fontSize: theme.typography.body1, | ||
|
@@ -29,10 +26,10 @@ const useStyles = (isMobile) => makeStyles((theme) => ({ | |
}, | ||
button: { | ||
background: theme.palette.primary.main, | ||
color:theme.palette.dark.contrastText, | ||
'&:hover':{ | ||
color: theme.palette.dark.contrastText, | ||
"&:hover": { | ||
background: theme.palette.secondary.main, | ||
} | ||
}, | ||
}, | ||
|
||
|
||
|
@@ -48,7 +45,7 @@ const ValidationPage = () => { | |
const [error, setError] = useState(""); | ||
|
||
|
||
useEffect( () => { | ||
useEffect(() => { | ||
async function validate() { | ||
try { | ||
setLoading(false); | ||
|
@@ -71,10 +68,10 @@ const ValidationPage = () => { | |
const { title, text } = success ? successMessage : getValidationMessage(error); | ||
return ( | ||
<CardContent className={classes.content}> | ||
<Typography variant="h5" className={classes.title} gutterBottom> | ||
<Typography variant="h5" className={classes.title} gutterBottom> | ||
{title} | ||
</Typography> | ||
<Typography variant="body1" gutterBottom align='center' > | ||
</Typography> | ||
<Typography variant="body1" gutterBottom align="center"> | ||
{text} | ||
{!success ? "For more information contact us at " : ""} | ||
<Link href={"mailto:[email protected]"}> [email protected]</Link> | ||
|
@@ -97,7 +94,7 @@ const ValidationPage = () => { | |
</CardContent> | ||
); | ||
} else { | ||
return getMessageCard(error); | ||
return getMessageCard(error); | ||
} | ||
|
||
}; | ||
|
Oops, something went wrong.