Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FE] refactor: 리뷰 그룹 생성 API 요청 함수 및 MSW 핸들러, 테스트 추가 #420

Merged
merged 9 commits into from
Aug 19, 2024

Conversation

ImxYJL
Copy link
Contributor

@ImxYJL ImxYJL commented Aug 18, 2024


🚀 어떤 기능을 구현했나요 ?

  • HomePage에서 이름, 프로젝트 이름, 비밀번호를 입력했을 때 ReviewDashboard로 접근할 수 있는 URL을 얻기 위한 API 호출 함수와 관련된 작업을 했습니다.

🔥 어떻게 해결했나요 ?

  • API 요청 함수를 만들고, 리액트 쿼리를 적용했습니다.
  • 새롭게 개편된 API에 따라 일부 훅, 컴포넌트, 변수명을 수정했습니다.
  • 새 API 테스트 코드(성공 케이스만 테스트)를 추가했습니다.

📝 어떤 부분에 집중해서 리뷰해야 할까요?

📚 참고 자료, 할 말

  • 디코에서 비밀번호 변수의 이름을 groupAccessCode로 통일하자고 했는데, 예전에 컴포넌트를 만들 때 이미 password라는 이름을 너무 많이 사용하고 있어서 컴포넌트상의 password는 별도로 수정하지 않고 API 요청을 보낼 때만 groupAccessCode로 명시해서 보내고 있습니다.
  • 상수 객체 이름 중에서 복수형인 것들 수정해야 합니다!


import QueryClientWrapper from '@/queryTestSetup/QueryClientWrapper';

import { CREATED_REVIEW_REQUEST_CODE } from '../../../mocks/mockData/group';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

경로에 절대 경로 사용하면 어떨까요?

Suggested change
import { CREATED_REVIEW_REQUEST_CODE } from '../../../mocks/mockData/group';
import { CREATED_REVIEW_REQUEST_CODE } from '@/mocks/mockData/group';

describe('usePostDataForReviewRequestCode', () => {
it('ReviewRequestCode를 발급받을 수 있다.', async () => {
// given
const dataForReviewRequestCode = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const dataForReviewRequestCode = {
const DATA_FOR_REVIEW_REQUEST_CODE= {

상수로 바꿔도 좋을 것 같아요.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이 변수는 해당 테스트에서만 사용돼서 일단 별도로 상수화하지는 않았습니다!

Copy link
Contributor

@chysis chysis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생했어요 👍

Copy link
Contributor

@BadaHertz52 BadaHertz52 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

올리 고생했어

@soosoo22 soosoo22 merged commit 468b0e2 into develop Aug 19, 2024
4 checks passed
@donghoony donghoony deleted the fe/feat/413-new-create-review-group-api branch August 20, 2024 01:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[FE] 리뷰 그룹 생성 API를 요청하기 위한 함수를 만들고, MSW를 이용해 모킹한다.
4 participants