From 41e62e5781583e18009401239da6e87a49e54b92 Mon Sep 17 00:00:00 2001 From: Gilpop8663 Date: Thu, 20 Jul 2023 12:02:24 +0900 Subject: [PATCH 1/6] =?UTF-8?q?test:=20(#64)=20=EC=B9=B4=ED=85=8C=EA=B3=A0?= =?UTF-8?q?=EB=A6=AC=EC=95=A0=20=EB=8C=80=ED=95=9C=20=ED=86=B5=EC=8B=A0=20?= =?UTF-8?q?=ED=85=8C=EC=8A=A4=ED=8A=B8=20=EC=BD=94=EB=93=9C=20=EC=9E=91?= =?UTF-8?q?=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/__test__/api/categoryList.test.ts | 46 ++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 frontend/__test__/api/categoryList.test.ts diff --git a/frontend/__test__/api/categoryList.test.ts b/frontend/__test__/api/categoryList.test.ts new file mode 100644 index 000000000..5c40d821f --- /dev/null +++ b/frontend/__test__/api/categoryList.test.ts @@ -0,0 +1,46 @@ +import { MOCK_CATEGORY_LIST } from '@mocks/mockData/categoryList'; + +const MEMBER = true; +const GUEST = false; + +describe('카테고리에 대한 통신이 의도한대로 작동하는 지 확인한다.', () => { + test('회원의 카테고리 정보를 불러올 수 있다.', async () => { + const data = await getUserCategoryList(MEMBER); + + expect(data).toBe(MOCK_CATEGORY_LIST); + }); + + test('비회원의 카테고리 정보를 불러올 수 있다.', async () => { + const data = await getUserCategoryList(GUEST); + + expect(data.postList).toEqual(MOCK_GUEST_CATEGORY_LIST); + }); + + test('회원이 카테고리 즐겨찾기를 할 수 있다.', () => { + MOCK_CATEGORY_LIST[1].isFavorite = false; + + await addFavoriteCategory(MOCK_CATEGORY_LIST[1].id); + + const data = await getUserCategoryList(MEMBER); + + expect(MOCK_CATEGORY_LIST[1].isFavorite).toBe(true); + }); + + test('회원이 카테고리 즐겨찾기를 해제할 수 있다.', async () => { + MOCK_CATEGORY_LIST[0].isFavorite = true; + + await removeFavoriteCategory(MOCK_CATEGORY_LIST[0].id); + + const data = await getUserCategoryList(MEMBER); + + expect(MOCK_CATEGORY_LIST[0].isFavorite).toBe(false); + }); + + test('클라이언트에서 사용하는 API 명세가 의도한대로 존재해야한다.', async () => { + const data = await getGuestCategoryList(GUEST); + + const dataKeys = Object.keys(data); + + expect(dataKeys).toEqual(['id', 'name', 'isFavorite']); + }); +}); From a9dd495db6a538f47d2709bf5370e435b941bbfe Mon Sep 17 00:00:00 2001 From: Gilpop8663 Date: Thu, 20 Jul 2023 12:02:57 +0900 Subject: [PATCH 2/6] =?UTF-8?q?feat:=20(#64)=20=EC=B9=B4=ED=85=8C=EA=B3=A0?= =?UTF-8?q?=EB=A6=AC=20=EB=A6=AC=EC=8A=A4=ED=8A=B8=20mock=20=EB=8D=B0?= =?UTF-8?q?=EC=9D=B4=ED=84=B0=20=EC=84=A0=EC=96=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/mocks/mockData/categoryList.ts | 27 +++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 frontend/src/mocks/mockData/categoryList.ts diff --git a/frontend/src/mocks/mockData/categoryList.ts b/frontend/src/mocks/mockData/categoryList.ts new file mode 100644 index 000000000..f17e3cdeb --- /dev/null +++ b/frontend/src/mocks/mockData/categoryList.ts @@ -0,0 +1,27 @@ +import { Category } from '@type/category'; + +export const MOCK_CATEGORY_LIST: Category[] = [ + { id: 1, name: '음식', isFavorite: false }, + { id: 2, name: '연애', isFavorite: true }, + { id: 3, name: '패션', isFavorite: false }, + { id: 4, name: '금융', isFavorite: false }, + { id: 5, name: '여행', isFavorite: false }, + { id: 6, name: '게임', isFavorite: false }, + { id: 7, name: '재테크', isFavorite: false }, + { id: 8, name: '요리', isFavorite: true }, + { id: 9, name: '개발', isFavorite: true }, + { id: 10, name: '전자기기', isFavorite: true }, +]; + +export const MOCK_GUEST_CATEGORY_LIST: Category[] = [ + { id: 1, name: '음식', isFavorite: false }, + { id: 2, name: '연애', isFavorite: false }, + { id: 3, name: '패션', isFavorite: false }, + { id: 4, name: '금융', isFavorite: false }, + { id: 5, name: '여행', isFavorite: false }, + { id: 6, name: '게임', isFavorite: false }, + { id: 7, name: '재테크', isFavorite: false }, + { id: 8, name: '요리', isFavorite: false }, + { id: 9, name: '개발', isFavorite: false }, + { id: 10, name: '전자기기', isFavorite: false }, +]; From 2643c93f1ee28a9c1f99335802f105b960f8a302 Mon Sep 17 00:00:00 2001 From: Gilpop8663 Date: Thu, 20 Jul 2023 12:03:27 +0900 Subject: [PATCH 3/6] =?UTF-8?q?feat:=20(#64)=20=EC=B9=B4=ED=85=8C=EA=B3=A0?= =?UTF-8?q?=EB=A6=AC=EC=97=90=20=EB=8C=80=ED=95=9C=20=ED=86=B5=EC=8B=A0=20?= =?UTF-8?q?=ED=95=A8=EC=88=98=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/mocks/wus/categoryList.ts | 31 ++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 frontend/src/mocks/wus/categoryList.ts diff --git a/frontend/src/mocks/wus/categoryList.ts b/frontend/src/mocks/wus/categoryList.ts new file mode 100644 index 000000000..07f316164 --- /dev/null +++ b/frontend/src/mocks/wus/categoryList.ts @@ -0,0 +1,31 @@ +import { Category } from '@type/category'; + +import { deleteFetch, getFetch, postFetch } from '@utils/fetch'; + +const transformCategoryListResponse = (categoryList: Category[]) => { + return categoryList.map(category => ({ + id: category.id, + name: category.name, + isFavorite: category.isFavorite, + })); +}; + +export const getUserCategoryList = async () => { + const categoryList = await getFetch('/categories'); + + return transformCategoryListResponse(categoryList); +}; + +export const getGuestCategoryList = async () => { + const categoryList = await getFetch('/categories/guest'); + + return transformCategoryListResponse(categoryList); +}; + +export const addFavoriteCategory = async (categoryId: number) => { + await postFetch(`/categories/${categoryId}/like`, ''); +}; + +export const removeFavoriteCategory = async (categoryId: number) => { + await deleteFetch(`/categories/${categoryId}/like`); +}; From 0eecba6355f28ccf121e484f32eac2d530de0e76 Mon Sep 17 00:00:00 2001 From: Gilpop8663 Date: Thu, 20 Jul 2023 13:23:46 +0900 Subject: [PATCH 4/6] =?UTF-8?q?feat:=20(#61)=20=EC=B9=B4=ED=85=8C=EA=B3=A0?= =?UTF-8?q?=EB=A6=AC=20=EB=A6=AC=EC=8A=A4=ED=8A=B8=20=EA=B4=80=EB=A0=A8?= =?UTF-8?q?=EB=90=9C=20msw=20=EC=BD=94=EB=93=9C=20=EC=9E=91=EC=84=B1=20?= =?UTF-8?q?=EC=84=9C=EB=B2=84=EC=97=90=EC=84=9C=20=EC=98=A4=EB=8A=94=20?= =?UTF-8?q?=EC=B9=B4=ED=85=8C=EA=B3=A0=EB=A6=AC=20=EB=A6=AC=EC=8A=A4?= =?UTF-8?q?=ED=8A=B8=20=ED=83=80=EC=9E=85=20=EC=84=A0=EC=96=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/__test__/api/categoryList.test.ts | 43 +++++++++++-------- frontend/src/api/wus/categoryList.ts | 31 ++++++++++++++ frontend/src/mocks/handlers.ts | 11 ++++- frontend/src/mocks/mockData/categoryList.ts | 46 ++++++++++----------- frontend/src/mocks/wus/categoryList.ts | 42 ++++++++----------- frontend/src/types/category.ts | 6 +++ 6 files changed, 113 insertions(+), 66 deletions(-) create mode 100644 frontend/src/api/wus/categoryList.ts diff --git a/frontend/__test__/api/categoryList.test.ts b/frontend/__test__/api/categoryList.test.ts index 5c40d821f..ee7cc68fe 100644 --- a/frontend/__test__/api/categoryList.test.ts +++ b/frontend/__test__/api/categoryList.test.ts @@ -1,46 +1,55 @@ -import { MOCK_CATEGORY_LIST } from '@mocks/mockData/categoryList'; +import { + addFavoriteCategory, + getGuestCategoryList, + getUserCategoryList, + removeFavoriteCategory, + transformCategoryListResponse, +} from '@api/wus/categoryList'; -const MEMBER = true; -const GUEST = false; +import { MOCK_CATEGORY_LIST, MOCK_GUEST_CATEGORY_LIST } from '@mocks/mockData/categoryList'; describe('카테고리에 대한 통신이 의도한대로 작동하는 지 확인한다.', () => { test('회원의 카테고리 정보를 불러올 수 있다.', async () => { - const data = await getUserCategoryList(MEMBER); + const data = await getUserCategoryList(); - expect(data).toBe(MOCK_CATEGORY_LIST); + const expectResult = transformCategoryListResponse(MOCK_CATEGORY_LIST); + + expect(data).toEqual(expectResult); }); test('비회원의 카테고리 정보를 불러올 수 있다.', async () => { - const data = await getUserCategoryList(GUEST); + const data = await getGuestCategoryList(); + + const expectResult = transformCategoryListResponse(MOCK_GUEST_CATEGORY_LIST); - expect(data.postList).toEqual(MOCK_GUEST_CATEGORY_LIST); + expect(data).toEqual(expectResult); }); - test('회원이 카테고리 즐겨찾기를 할 수 있다.', () => { - MOCK_CATEGORY_LIST[1].isFavorite = false; + test('회원이 카테고리 즐겨찾기를 할 수 있다.', async () => { + MOCK_CATEGORY_LIST[1].favorite = false; await addFavoriteCategory(MOCK_CATEGORY_LIST[1].id); - const data = await getUserCategoryList(MEMBER); + const data = await getUserCategoryList(); - expect(MOCK_CATEGORY_LIST[1].isFavorite).toBe(true); + expect(data[1].isFavorite).toBe(true); }); test('회원이 카테고리 즐겨찾기를 해제할 수 있다.', async () => { - MOCK_CATEGORY_LIST[0].isFavorite = true; + MOCK_CATEGORY_LIST[0].favorite = true; await removeFavoriteCategory(MOCK_CATEGORY_LIST[0].id); - const data = await getUserCategoryList(MEMBER); + const data = await getUserCategoryList(); - expect(MOCK_CATEGORY_LIST[0].isFavorite).toBe(false); + expect(data[0].isFavorite).toBe(false); }); test('클라이언트에서 사용하는 API 명세가 의도한대로 존재해야한다.', async () => { - const data = await getGuestCategoryList(GUEST); + const data = await getGuestCategoryList(); - const dataKeys = Object.keys(data); + const categoryKeys = Object.keys(data[0]); - expect(dataKeys).toEqual(['id', 'name', 'isFavorite']); + expect(categoryKeys).toEqual(['id', 'name', 'isFavorite']); }); }); diff --git a/frontend/src/api/wus/categoryList.ts b/frontend/src/api/wus/categoryList.ts new file mode 100644 index 000000000..62c176ab9 --- /dev/null +++ b/frontend/src/api/wus/categoryList.ts @@ -0,0 +1,31 @@ +import { ServerCategory } from '@type/category'; + +import { deleteFetch, getFetch, postFetch } from '@utils/fetch'; + +export const transformCategoryListResponse = (categoryList: ServerCategory[]) => { + return categoryList.map(category => ({ + id: category.id, + name: category.name, + isFavorite: category.favorite, + })); +}; + +export const getUserCategoryList = async () => { + const categoryList = await getFetch('/categories'); + + return transformCategoryListResponse(categoryList); +}; + +export const getGuestCategoryList = async () => { + const categoryList = await getFetch('/categories/guest'); + + return transformCategoryListResponse(categoryList); +}; + +export const addFavoriteCategory = async (categoryId: number) => { + await postFetch(`/categories/${categoryId}/like`, ''); +}; + +export const removeFavoriteCategory = async (categoryId: number) => { + await deleteFetch(`/categories/${categoryId}/like`); +}; diff --git a/frontend/src/mocks/handlers.ts b/frontend/src/mocks/handlers.ts index c3a6caf5a..d19620f79 100644 --- a/frontend/src/mocks/handlers.ts +++ b/frontend/src/mocks/handlers.ts @@ -1,6 +1,13 @@ import { example } from './example/get'; import { createEditPostTest } from './jero/post'; -import { votePostTest } from './sua/vote'; import { getVoteDetailTest } from './sua/getVoteDetail'; +import { votePostTest } from './sua/vote'; +import { mockCategoryHandlers } from './wus/categoryList'; -export const handlers = [...example, ...votePostTest, ...getVoteDetailTest, ...createEditPostTest]; +export const handlers = [ + ...example, + ...votePostTest, + ...getVoteDetailTest, + ...createEditPostTest, + ...mockCategoryHandlers, +]; diff --git a/frontend/src/mocks/mockData/categoryList.ts b/frontend/src/mocks/mockData/categoryList.ts index f17e3cdeb..cc7a28286 100644 --- a/frontend/src/mocks/mockData/categoryList.ts +++ b/frontend/src/mocks/mockData/categoryList.ts @@ -1,27 +1,27 @@ -import { Category } from '@type/category'; +import { ServerCategory } from '@type/category'; -export const MOCK_CATEGORY_LIST: Category[] = [ - { id: 1, name: '음식', isFavorite: false }, - { id: 2, name: '연애', isFavorite: true }, - { id: 3, name: '패션', isFavorite: false }, - { id: 4, name: '금융', isFavorite: false }, - { id: 5, name: '여행', isFavorite: false }, - { id: 6, name: '게임', isFavorite: false }, - { id: 7, name: '재테크', isFavorite: false }, - { id: 8, name: '요리', isFavorite: true }, - { id: 9, name: '개발', isFavorite: true }, - { id: 10, name: '전자기기', isFavorite: true }, +export const MOCK_CATEGORY_LIST: ServerCategory[] = [ + { id: 1, name: '음식', favorite: false }, + { id: 2, name: '연애', favorite: true }, + { id: 3, name: '패션', favorite: false }, + { id: 4, name: '금융', favorite: false }, + { id: 5, name: '여행', favorite: false }, + { id: 6, name: '게임', favorite: false }, + { id: 7, name: '재테크', favorite: false }, + { id: 8, name: '요리', favorite: true }, + { id: 9, name: '개발', favorite: true }, + { id: 10, name: '전자기기', favorite: true }, ]; -export const MOCK_GUEST_CATEGORY_LIST: Category[] = [ - { id: 1, name: '음식', isFavorite: false }, - { id: 2, name: '연애', isFavorite: false }, - { id: 3, name: '패션', isFavorite: false }, - { id: 4, name: '금융', isFavorite: false }, - { id: 5, name: '여행', isFavorite: false }, - { id: 6, name: '게임', isFavorite: false }, - { id: 7, name: '재테크', isFavorite: false }, - { id: 8, name: '요리', isFavorite: false }, - { id: 9, name: '개발', isFavorite: false }, - { id: 10, name: '전자기기', isFavorite: false }, +export const MOCK_GUEST_CATEGORY_LIST: ServerCategory[] = [ + { id: 1, name: '음식', favorite: false }, + { id: 2, name: '연애', favorite: false }, + { id: 3, name: '패션', favorite: false }, + { id: 4, name: '금융', favorite: false }, + { id: 5, name: '여행', favorite: false }, + { id: 6, name: '게임', favorite: false }, + { id: 7, name: '재테크', favorite: false }, + { id: 8, name: '요리', favorite: false }, + { id: 9, name: '개발', favorite: false }, + { id: 10, name: '전자기기', favorite: false }, ]; diff --git a/frontend/src/mocks/wus/categoryList.ts b/frontend/src/mocks/wus/categoryList.ts index 07f316164..0ad9ae89a 100644 --- a/frontend/src/mocks/wus/categoryList.ts +++ b/frontend/src/mocks/wus/categoryList.ts @@ -1,31 +1,25 @@ -import { Category } from '@type/category'; +import { rest } from 'msw'; -import { deleteFetch, getFetch, postFetch } from '@utils/fetch'; +import { MOCK_CATEGORY_LIST, MOCK_GUEST_CATEGORY_LIST } from '@mocks/mockData/categoryList'; -const transformCategoryListResponse = (categoryList: Category[]) => { - return categoryList.map(category => ({ - id: category.id, - name: category.name, - isFavorite: category.isFavorite, - })); -}; +export const mockCategoryHandlers = [ + rest.get('/categories', (req, res, ctx) => { + return res(ctx.status(200), ctx.json(MOCK_CATEGORY_LIST)); + }), -export const getUserCategoryList = async () => { - const categoryList = await getFetch('/categories'); + rest.get('/categories/guest', (req, res, ctx) => { + return res(ctx.status(200), ctx.json(MOCK_GUEST_CATEGORY_LIST)); + }), - return transformCategoryListResponse(categoryList); -}; + rest.post('/categories/:categoryId/like', (req, res, ctx) => { + MOCK_CATEGORY_LIST[1].favorite = true; -export const getGuestCategoryList = async () => { - const categoryList = await getFetch('/categories/guest'); + return res(ctx.status(201), ctx.json({ message: 'ok' })); + }), - return transformCategoryListResponse(categoryList); -}; + rest.delete('/categories/:categoryId/like', (req, res, ctx) => { + MOCK_CATEGORY_LIST[0].favorite = false; -export const addFavoriteCategory = async (categoryId: number) => { - await postFetch(`/categories/${categoryId}/like`, ''); -}; - -export const removeFavoriteCategory = async (categoryId: number) => { - await deleteFetch(`/categories/${categoryId}/like`); -}; + return res(ctx.status(204), ctx.json({ message: 'ok' })); + }), +]; diff --git a/frontend/src/types/category.ts b/frontend/src/types/category.ts index 774301439..64034d6bc 100644 --- a/frontend/src/types/category.ts +++ b/frontend/src/types/category.ts @@ -3,3 +3,9 @@ export interface Category { name: string; isFavorite: boolean; } + +export interface ServerCategory { + id: number; + name: string; + favorite: boolean; +} From 673af2ee9ee374f817156d529d386c64ddc61d37 Mon Sep 17 00:00:00 2001 From: Gilpop8663 Date: Thu, 20 Jul 2023 13:27:48 +0900 Subject: [PATCH 5/6] =?UTF-8?q?refactor:=20(#64)=20=ED=85=8C=EC=8A=A4?= =?UTF-8?q?=ED=8A=B8=EC=97=90=20=EB=8C=80=ED=95=9C=20=EC=84=A4=EB=AA=85?= =?UTF-8?q?=ED=95=98=EB=8A=94=20=EB=AC=B8=EC=9E=A5=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/__test__/api/categoryList.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/__test__/api/categoryList.test.ts b/frontend/__test__/api/categoryList.test.ts index ee7cc68fe..eaf34f352 100644 --- a/frontend/__test__/api/categoryList.test.ts +++ b/frontend/__test__/api/categoryList.test.ts @@ -8,7 +8,7 @@ import { import { MOCK_CATEGORY_LIST, MOCK_GUEST_CATEGORY_LIST } from '@mocks/mockData/categoryList'; -describe('카테고리에 대한 통신이 의도한대로 작동하는 지 확인한다.', () => { +describe('카테고리에 대한 통신(카테고리 목록 조회, 즐겨찾기 추가, 제거)이 올바르게 작동하는 지 확인한다.', () => { test('회원의 카테고리 정보를 불러올 수 있다.', async () => { const data = await getUserCategoryList(); @@ -45,7 +45,7 @@ describe('카테고리에 대한 통신이 의도한대로 작동하는 지 확 expect(data[0].isFavorite).toBe(false); }); - test('클라이언트에서 사용하는 API 명세가 의도한대로 존재해야한다.', async () => { + test('클라이언트에서 사용하는 API 명세가 [id, name, isFavorite]으로 존재해야한다.', async () => { const data = await getGuestCategoryList(); const categoryKeys = Object.keys(data[0]); From 93e5a182521472cad5922ef53fecb2a8d303c6bc Mon Sep 17 00:00:00 2001 From: gilpop8663 Date: Fri, 21 Jul 2023 01:50:36 +0900 Subject: [PATCH 6/6] =?UTF-8?q?refactor:=20(#64)=20=EC=BD=94=EB=93=9C=20?= =?UTF-8?q?=EA=B0=80=EB=8F=85=EC=84=B1=EC=9D=84=20=EC=9C=84=ED=95=B4=20?= =?UTF-8?q?=ED=83=80=EC=9E=85=20=EC=9D=B4=EB=A6=84=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/api/wus/categoryList.ts | 8 ++++---- frontend/src/mocks/mockData/categoryList.ts | 6 +++--- frontend/src/types/category.ts | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/frontend/src/api/wus/categoryList.ts b/frontend/src/api/wus/categoryList.ts index 62c176ab9..d899874af 100644 --- a/frontend/src/api/wus/categoryList.ts +++ b/frontend/src/api/wus/categoryList.ts @@ -1,8 +1,8 @@ -import { ServerCategory } from '@type/category'; +import { CategoryResponse } from '@type/category'; import { deleteFetch, getFetch, postFetch } from '@utils/fetch'; -export const transformCategoryListResponse = (categoryList: ServerCategory[]) => { +export const transformCategoryListResponse = (categoryList: CategoryResponse[]) => { return categoryList.map(category => ({ id: category.id, name: category.name, @@ -11,13 +11,13 @@ export const transformCategoryListResponse = (categoryList: ServerCategory[]) => }; export const getUserCategoryList = async () => { - const categoryList = await getFetch('/categories'); + const categoryList = await getFetch('/categories'); return transformCategoryListResponse(categoryList); }; export const getGuestCategoryList = async () => { - const categoryList = await getFetch('/categories/guest'); + const categoryList = await getFetch('/categories/guest'); return transformCategoryListResponse(categoryList); }; diff --git a/frontend/src/mocks/mockData/categoryList.ts b/frontend/src/mocks/mockData/categoryList.ts index cc7a28286..b8633d038 100644 --- a/frontend/src/mocks/mockData/categoryList.ts +++ b/frontend/src/mocks/mockData/categoryList.ts @@ -1,6 +1,6 @@ -import { ServerCategory } from '@type/category'; +import { CategoryResponse } from '@type/category'; -export const MOCK_CATEGORY_LIST: ServerCategory[] = [ +export const MOCK_CATEGORY_LIST: CategoryResponse[] = [ { id: 1, name: '음식', favorite: false }, { id: 2, name: '연애', favorite: true }, { id: 3, name: '패션', favorite: false }, @@ -13,7 +13,7 @@ export const MOCK_CATEGORY_LIST: ServerCategory[] = [ { id: 10, name: '전자기기', favorite: true }, ]; -export const MOCK_GUEST_CATEGORY_LIST: ServerCategory[] = [ +export const MOCK_GUEST_CATEGORY_LIST: CategoryResponse[] = [ { id: 1, name: '음식', favorite: false }, { id: 2, name: '연애', favorite: false }, { id: 3, name: '패션', favorite: false }, diff --git a/frontend/src/types/category.ts b/frontend/src/types/category.ts index 64034d6bc..417bf7633 100644 --- a/frontend/src/types/category.ts +++ b/frontend/src/types/category.ts @@ -4,7 +4,7 @@ export interface Category { isFavorite: boolean; } -export interface ServerCategory { +export interface CategoryResponse { id: number; name: string; favorite: boolean;