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: LandingPage에서 사용하는 Input 유효성 검사 함수 분리 및 테스트 작성 #349

Merged
merged 3 commits into from
Aug 14, 2024

Conversation

ImxYJL
Copy link
Contributor

@ImxYJL ImxYJL commented Aug 14, 2024


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

  • 관련 컴포넌트에서 수행하던 Input 유효성 검사 함수를 별도의 유틸리티 함수로 분리했습니다.
  • 분리한 유틸리티 함수에 대한 테스트를 추가했습니다.

🔥 어떻게 해결했나요 ?

  • Input 유효성 검증을 위한 e2e 테스트보다 Input에서 직접적으로 사용하는 함수 로직을 테스트하는 것이 낫다고 생각해서 jest 테스트를 진행했습니다.

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

  • 테스트 설명이 괜찮은지 봐주세요~
  • 유틸 함수 리팩토링 요청도 환영합니다

📚 참고 자료, 할 말

  • I WANT TO GO HOME

return input.length <= length;
};

const MAX_VALID_REVIEW_GROUP_DATA_INPUT = 50;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

이 상수 부분은 폼 로직과 관련된 값입니다. 이 상수를 컴포넌트 파일에 둘지 여기다 둘지 고민했는데 이 유틸 함수를 해당 컴포넌트에서만 사용한다고 가정했기 때문에,(추후 기본 함수들은 전역으로 뺄 수도 있겠지만) 해당 컴포넌트의 유효성 검증을 위한 파일로 만들자고 생각해서 일단 여기에 두기로 했습니다

@ImxYJL ImxYJL changed the title [FE] refactor: LandingPage에서 사용하는 Input 유효성 검사 함수 분리 [FE] refactor: LandingPage에서 사용하는 Input 유효성 검사 함수 분리 및 테스트 작성 Aug 14, 2024
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.

테스트 까지 고생했어 올리

Copy link
Contributor

@soosoo22 soosoo22 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

@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.

고생했어요! 사소한 궁금증이 있어 코멘트 남겼어요.

Comment on lines +1 to +3
export const isNotEmptyInput = (input: string) => {
return input !== '';
};
Copy link
Contributor

Choose a reason for hiding this comment

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

사소하지만 부정 조건문으로 판단한 이유가 있을까요?

@ImxYJL ImxYJL merged commit 7f281d8 into develop Aug 14, 2024
4 checks passed
@donghoony donghoony deleted the fe/refactor/336-landing-page-utility-function 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] LandingPage에서 유틸 함수를 분리한다.
4 participants