[test] calc·storage·passwordHash·useDebouncedInput 단위 테스트 추가#117
Open
dasomel wants to merge 1 commit into
Open
[test] calc·storage·passwordHash·useDebouncedInput 단위 테스트 추가#117dasomel wants to merge 1 commit into
dasomel wants to merge 1 commit into
Conversation
calc, storage, passwordHash 유틸리티와 useDebouncedInput 훅에 대한 단위 테스트를 추가하여 핵심 비즈니스 로직의 동작을 검증한다. - calc.itemIdxByPage: 역순 인덱스 계산 6개 케이스 검증 - storage: localStorage/sessionStorage CRUD 동작 9개 케이스 검증 - passwordHash: SHA-256 기반 Base64 해싱 5개 케이스 검증 - useDebouncedInput: 디바운싱 지연·연속호출·상태업데이트 5개 케이스 검증
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
변경 사유
calc,storage,passwordHash유틸리티와useDebouncedInput훅은 실제 서비스에서 사용되는 핵심 로직이지만 단위 테스트가 없었습니다. 로직 변경 시 회귀를 방지하기 위해 테스트를 추가합니다.변경 내용
src/utils/calc.test.js:itemIdxByPage함수 역순 인덱스 계산 6개 케이스src/utils/storage.test.js:localStorage/sessionStorageCRUD 동작 9개 케이스 (vi.stubGlobal 모킹)src/utils/passwordHash.test.js: SHA-256 기반 Base64 해싱 동작 5개 케이스src/hooks/useDebounce.test.jsx:useDebouncedInput디바운싱 지연·연속호출·상태업데이트 5개 케이스테스트 결과
vitest run 기준 25개 테스트 전부 통과
영향 범위
체크리스트