diff --git a/apps/web/src/app/university/application/apply/LanguageStep.tsx b/apps/web/src/app/university/application/apply/LanguageStep.tsx index b27c67bf..f5d8d586 100644 --- a/apps/web/src/app/university/application/apply/LanguageStep.tsx +++ b/apps/web/src/app/university/application/apply/LanguageStep.tsx @@ -5,7 +5,7 @@ import ScoreCard from "@/app/university/score/ScoreCard"; import TextModal from "@/components/modal/TextModal"; import Tab from "@/components/ui/Tab"; import { toast } from "@/lib/zustand/useToastStore"; -import { type LanguageTestScore, languageTestScoreInfo, ScoreSubmitStatus } from "@/types/score"; +import { formatLanguageTestScoreWithMax, type LanguageTestScore, ScoreSubmitStatus } from "@/types/score"; import ApplicationBottomActionBar from "../_components/ApplicationBottomActionBar"; import ApplicationSectionTitle from "../_components/ApplicationSectionTitle"; @@ -57,7 +57,10 @@ const LanguageStep = ({ { @@ -67,7 +67,7 @@ const LanguageTestSubmitForm = () => { { label: "공인어학", status: submittedTestInfo.label, - details: `${submittedData.score}/${submittedTestInfo.max}`, + details: formatLanguageTestScoreWithMax(submittedData.testType, submittedData.score), }, { label: "어학증명서", diff --git a/apps/web/src/types/score.ts b/apps/web/src/types/score.ts index 30ef8258..2b64419c 100644 --- a/apps/web/src/types/score.ts +++ b/apps/web/src/types/score.ts @@ -65,6 +65,32 @@ export const languageTestShortMapping: Record = { DUOLINGO: "DUOLINGO", }; +const jlptLevelMapping: Record = { + "1": "N1", + "2": "N2", + "3": "N3", + "4": "N4", + "5": "N5", +}; + +export const formatLanguageTestScore = (testType: LanguageTestEnum, score: string) => { + if (testType === LanguageTestEnum.JLPT) { + return jlptLevelMapping[score] ?? score; + } + + return score; +}; + +export const formatLanguageTestScoreWithMax = (testType: LanguageTestEnum, score: string) => { + const formattedScore = formatLanguageTestScore(testType, score); + + if (testType === LanguageTestEnum.JLPT) { + return formattedScore; + } + + return `${formattedScore}/${languageTestScoreInfo[testType].max}`; +}; + export interface SubmitGpaScoreRequest { gpaScoreRequest: { gpa: number;