fix(test): e2e me 쿼리 mock 에 account_identities 추가#125
Conversation
toMePayload 가 account_identities.map 을 호출하는데 e2e mock 의 findAccountWithProfile 반환값에 해당 필드가 없어 상시 실패하던 것을 해소. mock 을 실제 repository 반환 형태에 맞춰 account_identities: [] 추가.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Coverage report
Test suite run success1240 tests passing in 144 suites. Report generated by 🧪jest coverage report action from 56d04e5 |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Summary
develop 에서 상시 실패하던 e2e 테스트(
GraphQL me는 인증이 통과되어야 한다)를 고칩니다. 프로덕션 버그가 아니라 테스트 mock 결함입니다.toMePayload가account.account_identities.map(...)로 연동 소셜 계정을 매핑하는데(소셜 provider 노출 기능), e2e 의mockUserRepository.findAccountWithProfile가account_identities를 반환하지 않아Cannot read properties of undefined (reading 'map')로 깨지고 있었습니다. mock 에account_identities: []를 추가해 실제 repository 반환 형태와 맞춥니다.Scope
변경
test/app.e2e-spec.ts—mockUserRepository.findAccountWithProfile의 반환 객체에account_identities: []추가프로덕션 코드 변경 없음. 테스트 mock 한 줄.
Impact
Test plan
yarn test:e2e— 7/7 통과