Skip to content

Feat/hook test#422

Merged
hexdrinker merged 4 commits into
developfrom
feat/hook-test
May 2, 2026
Merged

Feat/hook test#422
hexdrinker merged 4 commits into
developfrom
feat/hook-test

Conversation

@hexdrinker

Copy link
Copy Markdown
Collaborator

개요

admin 영역의 훅 테스트 커버리지를 보강하고, 훅 소비 컴포넌트(ShareBanner) 통합 테스트를 추가했습니다.
회귀 위험이 높은 타이머/브라우저 이벤트/스토리지/DOM side-effect 중심으로 검증 범위를 확장했습니다.

변경 사항

1) Hook Unit Test 추가

  • apps/admin/src/hooks/useShareBannerVisibility.test.ts
  • apps/admin/src/hooks/usePopupDialog.test.tsx
  • apps/admin/src/hooks/useDeviceWidth.test.ts
  • apps/admin/src/hooks/useClipboardCopy.test.ts
  • apps/admin/src/hooks/useBodyScrollLock.test.ts
  • apps/admin/src/hooks/useIsMobile.test.ts
  • apps/admin/src/hooks/useScrollDirection.test.ts
  • apps/admin/src/hooks/useCookie.test.ts

핵심 검증 포인트:

  • 타이머/디바운스/스크롤 이벤트
  • 쿠키/스토리지 side-effect
  • 팝업 분기(EVENT/NOTICE, 기간, 쿠키 여부)
  • 모바일 breakpoint 분기

2) Hook 소비 통합 테스트 추가

  • apps/admin/src/components/ShareBanner/ShareBanner.integration.test.tsx

핵심 검증 포인트:

  • isVisible에 따른 렌더링 분기
  • 닫기 버튼 클릭 시 dismissForToday 호출
  • 공유 버튼 클릭 시 navigator.share 호출

검증

  • 실행 명령: yarn workspace admin test
  • 결과: 전체 테스트 통과 (현재 브랜치 기준 green)

참고

  • 이번 PR은 develop 대비 아래 파일만 추가되었습니다.
    • apps/admin/src/components/ShareBanner/ShareBanner.integration.test.tsx
    • apps/admin/src/hooks/useBodyScrollLock.test.ts
    • apps/admin/src/hooks/useClipboardCopy.test.ts
    • apps/admin/src/hooks/useCookie.test.ts
    • apps/admin/src/hooks/useDeviceWidth.test.ts
    • apps/admin/src/hooks/useIsMobile.test.ts
    • apps/admin/src/hooks/usePopupDialog.test.tsx
    • apps/admin/src/hooks/useScrollDirection.test.ts
    • apps/admin/src/hooks/useShareBannerVisibility.test.ts

@hexdrinker hexdrinker merged commit 704a94c into develop May 2, 2026
1 check passed
@hexdrinker hexdrinker deleted the feat/hook-test branch May 2, 2026 07:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant