Conversation
- Google Calendar 및 Notion 이벤트를 통합 형식으로 변환하는 함수 추가 - formatDateOnly 함수에 대한 테스트 케이스 작성 - 한국어 로케일에 맞춘 날짜 포맷팅 테스트 케이스 추가
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning
|
| Cohort / File(s) | Summary |
|---|---|
캘린더 동기화 테스트 frontend/src/utils/calendarSyncUtils.test.ts |
Google 및 Notion 이벤트를 통합 형식으로 변환하는 함수들에 대한 테스트 추가. 날짜 포맷팅(formatDateOnly), Google 이벤트 변환(ID 접두사, dateKey 생성, 필드 통과), Notion 이벤트 변환(필드 매핑 및 기본값 설정), 불완전한 데이터 처리에 대한 검증 포함. |
Estimated code review effort
🎯 2 (Simple) | ⏱️ ~12 minutes
Possibly related PRs
- [feature] Google Calendar 이벤트와 Notion 캘린더 페이지 통합 #1376: 이 PR에서 구현된 새로운 UnifiedCalendarEvent 유틸리티 및 타입(formatDateOnly, convertGoogleEventToUnified, convertNotionEventToUnified, GoogleCalendarEvent)에 대한 테스트를 추가합니다.
Suggested reviewers
- lepitaaar
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
| Check name | Status | Explanation |
|---|---|---|
| Description Check | ✅ Passed | Check skipped - CodeRabbit’s high-level summary is enabled. |
| Title check | ✅ Passed | PR 제목이 테스트 케이스 추가에 대한 내용을 명확하게 설명하고 있으며, 변경 사항의 주요 초점인 날짜 포맷팅 테스트와 일치합니다. |
| Docstring Coverage | ✅ Passed | No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. |
✏️ Tip: You can configure your own custom pre-merge checks in the settings.
✨ Finishing Touches
📝 Generate docstrings
- Create stacked PR
- Commit on current branch
🧪 Generate unit tests (beta)
- Create PR with unit tests
- Commit unit tests in branch
feature/#1377-calendar-test-MOA-781
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 @coderabbitai help to get the list of available commands and usage tips.
🎨 UI 변경사항을 확인해주세요
4개 스토리 변경 · 전체 56개 스토리 · 22개 컴포넌트 |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
frontend/src/utils/calendarSyncUtils.test.ts (2)
183-191: ID 픽스처가 실제 계약보다 과하게 prefix 친화적이라 테스트 의도가 흐려집니다.입력 ID를 이미
google-.../notion-...형태로 두고google-google-.../notion-notion-...를 기대하면, 실제 계약(원본 ID + 단일 prefix 부여) 검증력이 약해집니다. 특히useUnifiedCalendarUiState의 단일.replace('google-', '')/.replace('notion-', '')흐름과 맞물려 회귀 탐지가 어려워질 수 있습니다.픽스처 현실성 개선 예시 diff
const googleEvent: GoogleCalendarEvent = { - id: 'google-event-1', + id: 'event-1', title: 'Google 미팅', start: '2026-03-20T10:00:00Z', end: '2026-03-20T11:00:00Z', - url: 'https://calendar.google.com/event?id=google-event-1', + url: 'https://calendar.google.com/event?id=event-1', description: '팀 회의', source: 'GOOGLE', }; ... -expect(unified?.id).toBe('google-google-event-1'); +expect(unified?.id).toBe('google-event-1'); const notionEvent = { - id: 'notion-page-1', + id: 'page-1', title: 'Notion 작업', start: '2026-03-21', dateKey: '2026-03-21', end: '2026-03-22', url: 'https://www.notion.so/page-1', }; ... -expect(unified.id).toBe('notion-notion-page-1'); +expect(unified.id).toBe('notion-page-1');Also applies to: 196-196, 219-226, 230-230, 249-249
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@frontend/src/utils/calendarSyncUtils.test.ts` around lines 183 - 191, The test fixtures use already-prefixed IDs (e.g., 'google-event-1', 'notion-event-1') which masks the real contract of adding a single provider prefix in useUnifiedCalendarUiState; update the Google/Notion event fixtures (symbols: googleEvent, notionEvent and any similar fixtures around the noted ranges) to use raw IDs without provider prefixes (e.g., 'event-1'), and adjust the expected IDs in assertions to match a single prefixed form produced by the code (e.g., 'google-event-1' or 'notion-event-1'), ensuring the test exercises the .replace('google-', '') / .replace('notion-', '') behavior correctly across all referenced fixtures.
86-91: 로케일 포맷 테스트가 너무 느슨해서 회귀를 놓칠 수 있습니다.현재
toContain('3'),toContain('19')는 다른 포맷(심지어 비한국어 포맷)도 통과할 수 있습니다.ko-KR기준 날짜 파트를 기준값으로 만들어 검증하는 편이 더 안전합니다.테스트 강화를 위한 예시 diff
it('유효한 날짜는 한국어 로케일로 포맷한다', () => { - const result = formatDateText('2026-03-19T10:30:00Z'); - expect(result).toContain('2026'); - expect(result).toContain('3'); - expect(result).toContain('19'); + const input = '2026-03-19T10:30:00Z'; + const result = formatDateText(input); + const expectedDatePart = new Intl.DateTimeFormat('ko-KR', { + year: 'numeric', + month: 'numeric', + day: 'numeric', + }).format(new Date(input)); + expect(result).toContain(expectedDatePart); });🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@frontend/src/utils/calendarSyncUtils.test.ts` around lines 86 - 91, The test for formatDateText is too loose (it only asserts contains '3' and '19') and can pass for non-Korean formats; update the test to assert against an explicit ko-KR formatted output instead. Specifically, call formatDateText('2026-03-19T10:30:00Z') and compare the result to the expected string assembled using Intl.DateTimeFormat('ko-KR', { year:'numeric', month:'numeric', day:'numeric', hour:'numeric', minute:'numeric' }) or to the known expected literal (e.g., "2026년 3월 19일 ...") so the assertion checks exact date parts for the ko-KR locale rather than loose contains checks; update the test case in calendarSyncUtils.test.ts that references formatDateText accordingly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@frontend/src/utils/calendarSyncUtils.test.ts`:
- Around line 183-191: The test fixtures use already-prefixed IDs (e.g.,
'google-event-1', 'notion-event-1') which masks the real contract of adding a
single provider prefix in useUnifiedCalendarUiState; update the Google/Notion
event fixtures (symbols: googleEvent, notionEvent and any similar fixtures
around the noted ranges) to use raw IDs without provider prefixes (e.g.,
'event-1'), and adjust the expected IDs in assertions to match a single prefixed
form produced by the code (e.g., 'google-event-1' or 'notion-event-1'), ensuring
the test exercises the .replace('google-', '') / .replace('notion-', '')
behavior correctly across all referenced fixtures.
- Around line 86-91: The test for formatDateText is too loose (it only asserts
contains '3' and '19') and can pass for non-Korean formats; update the test to
assert against an explicit ko-KR formatted output instead. Specifically, call
formatDateText('2026-03-19T10:30:00Z') and compare the result to the expected
string assembled using Intl.DateTimeFormat('ko-KR', { year:'numeric',
month:'numeric', day:'numeric', hour:'numeric', minute:'numeric' }) or to the
known expected literal (e.g., "2026년 3월 19일 ...") so the assertion checks exact
date parts for the ko-KR locale rather than loose contains checks; update the
test case in calendarSyncUtils.test.ts that references formatDateText
accordingly.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 18f8f1d0-a5ec-4f29-b593-e16a43a64fa7
📒 Files selected for processing (1)
frontend/src/utils/calendarSyncUtils.test.ts
#️⃣연관된 이슈
📝작업 내용
중점적으로 리뷰받고 싶은 부분(선택)
논의하고 싶은 부분(선택)
🫡 참고사항
Summary by CodeRabbit
릴리스 노트
이 업데이트는 내부 테스트 강화에 중점을 두었습니다.