Skip to content

Commit

Permalink
Tests for validation page
Browse files Browse the repository at this point in the history
Co-authored-by: Daniel Ferreira <[email protected]>
  • Loading branch information
FranciscoCardoso913 and dsantosferreira committed Aug 19, 2023
1 parent 3a5a721 commit 4f85e5f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/components/Apply/Company/CompanyApplicationUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ const ValidationMessages = Object.freeze({
},
});

export const getValidationError = (error) => {
export const getValidationMessage = (description) => {
const errorMsg = { title: "Unexpected Error!", text: "An unexpected error has occurred while validating your application. " };
if (!error) {
if (!description) {
return errorMsg;
}
if (typeof ValidationMessages[description] === "object") {
Expand Down
4 changes: 2 additions & 2 deletions src/pages/ValidationPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const useStyles = (isMobile) => makeStyles((theme) => ({
}
},


}));

const ValidationPage = () => {
Expand Down Expand Up @@ -68,7 +68,7 @@ const ValidationPage = () => {

const getMessageCard = (error) => {

const { title, text } = success ? successMessage : getValidationError(error);
const { title, text } = success ? successMessage : getValidationMessage(error);
return (
<CardContent className={classes.content}>
<Typography variant="h5" className={classes.title} gutterBottom>
Expand Down

0 comments on commit 4f85e5f

Please sign in to comment.