From 98780d596ea6f28fdd7e93783ebf7e2b1d635f6b Mon Sep 17 00:00:00 2001 From: HC-kang Date: Sat, 30 Nov 2024 16:25:15 +0900 Subject: [PATCH] =?UTF-8?q?temp:=20Card=20=EC=BB=B4=ED=8F=AC=EB=84=8C?= =?UTF-8?q?=ED=8A=B8=20=EB=82=B4=20Grade=20=ED=83=80=EC=9E=85=20=EC=9D=98?= =?UTF-8?q?=EC=A1=B4=EC=84=B1=20=EC=9E=84=EC=8B=9C=20=EC=9E=91=EC=97=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Card/Card.test.tsx | 16 +++++++--------- src/components/Card/Card.tsx | 8 +++++--- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/components/Card/Card.test.tsx b/src/components/Card/Card.test.tsx index ed976c98..428d8c60 100644 --- a/src/components/Card/Card.test.tsx +++ b/src/components/Card/Card.test.tsx @@ -1,30 +1,28 @@ import { render, screen, within } from "@testing-library/react"; import { expect, test } from "vitest"; -import { Grade } from "../../api/services/common/types"; +import { Grade } from "../../api/services/types"; import Card from "./Card"; test("render grade image", () => { - render(); + render(); expect( - screen.getByRole("img", { name: `${Grade.BIG_TREE} image` }), + screen.getByRole("img", { name: `${Grade.TREE} image` }), ).toBeInTheDocument(); }); test("render github name", () => { const name = "user123"; - render(); + render(); expect(screen.getByRole("region", { name })).toBeInTheDocument(); }); test("render cohort", () => { const cohort = 2; - render( - , - ); + render(); expect( screen.getByRole("region", { name: `${cohort}κΈ°` }), @@ -33,7 +31,7 @@ test("render cohort", () => { test("render progress link", () => { const id = "test"; - render(); + render(); const link = within( screen.getByRole("region", { name: `card-navigation-${id}` }), @@ -45,7 +43,7 @@ test("render progress link", () => { test("render certificate link", () => { const id = "test"; - render(); + render(); const link = within( screen.getByRole("region", { name: `card-navigation-${id}` }), diff --git a/src/components/Card/Card.tsx b/src/components/Card/Card.tsx index bd8b545f..26dc7467 100644 --- a/src/components/Card/Card.tsx +++ b/src/components/Card/Card.tsx @@ -2,7 +2,7 @@ import Seed from "../../assets/Seed.png"; import Sprout from "../../assets/Sprout.png"; import YoungTree from "../../assets/YoungTree.png"; import LargeTree from "../../assets/LargeTree.png"; -import type { Grade } from "../../api"; +import { Grade } from "../../api/services/types"; import Link from "../Link/Link"; import styles from "./Card.module.css"; @@ -17,8 +17,10 @@ interface CardProps { const imageTable = { SEED: Seed, SPROUT: Sprout, - SMALL_TREE: YoungTree, - BIG_TREE: LargeTree, + LEAF: Sprout, + BRANCH: Sprout, + FRUIT: YoungTree, + TREE: LargeTree, }; export default function Card({ id, name, cohort, grade }: CardProps) {