fix(02): show owner name / Family in event popover footer
Backend: - expand.ts: add ownerName: string | null to CalendarOccurrence interface and expandOccurrences() signature; thread it onto every emitted occurrence. - events.ts: SELECT users.displayName as ownerName in the join; pass it to expandOccurrences(). Frontend: - client.ts: add ownerName: string | null to CalendarOccurrence. - EventDetailPopover.tsx: render isShared ? 'Family' : (ownerName ?? calendarName) in the footer instead of calendarName. Tests: - expand.test.ts: pass ownerName to all expandOccurrences() calls; assert ownerName is carried onto occurrences in the DST test. - events.test.ts: add ownerName to mock rows; assert ownerName present on occurrences; add ownerName assertion to timed-recurring test. - EventDetailPopover.test.tsx: add ownerName to fixtures; split "calendar name in footer" into three targeted tests covering personal-with-owner, shared→Family, and null-owner fallback.
This commit is contained in:
@@ -46,6 +46,7 @@ describe('expandOccurrences', () => {
|
||||
1, // calendarId
|
||||
'My Calendar', // calendarName
|
||||
1, // ownerUserId
|
||||
'Alice', // ownerName
|
||||
'#4A90D9', // color
|
||||
false, // isShared
|
||||
)
|
||||
@@ -58,6 +59,8 @@ describe('expandOccurrences', () => {
|
||||
// after DST: '...T10:00:00-04:00[America/New_York]'. Both include the IANA bracket.
|
||||
for (const occ of occurrences) {
|
||||
expect(occ.allDay).toBe(false)
|
||||
// ownerName must be threaded through to every occurrence
|
||||
expect(occ.ownerName).toBe('Alice')
|
||||
// start must be IANA-annotated: '2026-03-01T10:00:00-05:00[America/New_York]'
|
||||
expect(occ.start).toMatch(/T10:00:00/)
|
||||
// Must include IANA bracket — offset-only strings fail Temporal.ZonedDateTime.from()
|
||||
@@ -96,6 +99,7 @@ describe('expandOccurrences', () => {
|
||||
1,
|
||||
'My Calendar',
|
||||
1,
|
||||
null, // ownerName
|
||||
'#4A90D9',
|
||||
false,
|
||||
)
|
||||
@@ -127,6 +131,7 @@ describe('expandOccurrences', () => {
|
||||
1,
|
||||
'My Calendar',
|
||||
1,
|
||||
null, // ownerName
|
||||
'#4A90D9',
|
||||
false,
|
||||
)
|
||||
@@ -156,6 +161,7 @@ describe('expandOccurrences', () => {
|
||||
1,
|
||||
'My Calendar',
|
||||
1,
|
||||
null, // ownerName
|
||||
'#4A90D9',
|
||||
false,
|
||||
)
|
||||
@@ -196,6 +202,7 @@ describe('expandOccurrences', () => {
|
||||
1,
|
||||
'My Calendar',
|
||||
1,
|
||||
null, // ownerName
|
||||
'#4A90D9',
|
||||
false,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user