Update layout
This commit is contained in:
+54
-5
@@ -57,6 +57,41 @@ DTSTART;VALUE=DATE:20260122
|
||||
DTEND;VALUE=DATE:20260123
|
||||
SUMMARY:✈️ 💜 Madeira
|
||||
END:VEVENT
|
||||
BEGIN:VEVENT
|
||||
UID:overlap-a@test
|
||||
DTSTAMP:20260101T000000Z
|
||||
DTSTART;TZID=UTC:20260109T090000
|
||||
DTEND;TZID=UTC:20260109T100000
|
||||
SUMMARY:✈️ Overlap A
|
||||
END:VEVENT
|
||||
BEGIN:VEVENT
|
||||
UID:overlap-b@test
|
||||
DTSTAMP:20260101T000000Z
|
||||
DTSTART;TZID=UTC:20260109T093000
|
||||
DTEND;TZID=UTC:20260109T110000
|
||||
SUMMARY:💜 Overlap B
|
||||
END:VEVENT
|
||||
BEGIN:VEVENT
|
||||
UID:overlap-resolved-a@test
|
||||
DTSTAMP:20260101T000000Z
|
||||
DTSTART;TZID=UTC:20260113T090000
|
||||
DTEND;TZID=UTC:20260113T100000
|
||||
SUMMARY:✈️ Overlap C nc
|
||||
END:VEVENT
|
||||
BEGIN:VEVENT
|
||||
UID:quickadd-1@test
|
||||
DTSTAMP:20260101T000000Z
|
||||
DTSTART:20260116T070000Z
|
||||
DTEND:20260116T080000Z
|
||||
SUMMARY:Quick add
|
||||
END:VEVENT
|
||||
BEGIN:VEVENT
|
||||
UID:overlap-resolved-b@test
|
||||
DTSTAMP:20260101T000000Z
|
||||
DTSTART;TZID=UTC:20260113T093000
|
||||
DTEND;TZID=UTC:20260113T110000
|
||||
SUMMARY:💜 Overlap D
|
||||
END:VEVENT
|
||||
END:VCALENDAR
|
||||
`;
|
||||
|
||||
@@ -69,7 +104,7 @@ const overview = buildOverview(ICS, tagsConfig, '2026-01-01', '2026-01-31');
|
||||
|
||||
// plain weekly recurrence: morning segment, untagged -> muted
|
||||
assert.deepEqual(overview['2026-01-05'].segments, ['muted', null, null]);
|
||||
assert.match(overview['2026-01-05'].tooltip, /09:00 Standup/);
|
||||
assert.match(overview['2026-01-05'].tooltip, /10:00 Standup/);
|
||||
|
||||
// EXDATE removes this occurrence entirely (nothing else touches this day)
|
||||
assert.equal(overview['2026-01-19'], undefined);
|
||||
@@ -79,7 +114,7 @@ assert.equal(overview['2026-01-26'], undefined);
|
||||
|
||||
// ...to Jan 27, 14:00 -> afternoon segment
|
||||
assert.deepEqual(overview['2026-01-27'].segments, [null, 'muted', null]);
|
||||
assert.match(overview['2026-01-27'].tooltip, /14:00 Standup \(moved\)/);
|
||||
assert.match(overview['2026-01-27'].tooltip, /15:00 Standup \(moved\)/);
|
||||
|
||||
// all-day multi-day event with a known leading emoji lights every segment, both spanned days
|
||||
assert.deepEqual(overview['2026-01-10'].segments, ['magenta', 'magenta', 'magenta']);
|
||||
@@ -91,15 +126,15 @@ assert.deepEqual(overview['2026-01-12'].segments, ['muted', null, null]);
|
||||
|
||||
// leading emoji that IS in tagsConfig takes that entry's color, not re-prefixed in tooltip
|
||||
assert.deepEqual(overview['2026-01-06'].segments, ['aqua', null, null]);
|
||||
assert.equal(overview['2026-01-06'].tooltip, '10:00 ✈️ Flight to Spain');
|
||||
assert.equal(overview['2026-01-06'].tooltip, '11:00 ✈️ Flight to Spain');
|
||||
|
||||
// leading emoji NOT in tagsConfig still stands out (not muted) via the fallback color
|
||||
assert.deepEqual(overview['2026-01-08'].segments, [null, null, 'blue']);
|
||||
assert.equal(overview['2026-01-08'].tooltip, '20:00 🎉 Party');
|
||||
assert.equal(overview['2026-01-08'].tooltip, '21:00 🎉 Party');
|
||||
|
||||
// two consecutive leading emoji (no space between) split the segment into both colors
|
||||
assert.deepEqual(overview['2026-01-15'].segments, [['aqua', 'magenta'], null, null]);
|
||||
assert.equal(overview['2026-01-15'].tooltip, '09:00 ✈️💜 Trip with Tessa');
|
||||
assert.equal(overview['2026-01-15'].tooltip, '10:00 ✈️💜 Trip with Tessa');
|
||||
// single-emoji case (Jan 6, asserted above) still resolves to a plain string, not an array —
|
||||
// the split path only triggers for a genuine two-emoji run.
|
||||
assert.equal(Array.isArray(overview['2026-01-06'].segments[0]), false);
|
||||
@@ -108,4 +143,18 @@ assert.equal(Array.isArray(overview['2026-01-06'].segments[0]), false);
|
||||
assert.deepEqual(overview['2026-01-22'].segments, [['aqua', 'magenta'], ['aqua', 'magenta'], ['aqua', 'magenta']]);
|
||||
assert.equal(overview['2026-01-22'].tooltip, 'All day ✈️ 💜 Madeira');
|
||||
|
||||
// two tagged events overlapping in time -> conflict flagged on their shared day
|
||||
assert.equal(overview['2026-01-09'].conflict, true);
|
||||
// a day with only one tagged event -> no conflict
|
||||
assert.equal(overview['2026-01-06'].conflict, false);
|
||||
// untagged (muted) events don't count as a conflict even when they overlap
|
||||
assert.equal(overview['2026-01-05'].conflict, false);
|
||||
|
||||
// "nc" as a standalone word in the title marks that event's conflict as resolved
|
||||
assert.equal(overview['2026-01-13'].conflict, false);
|
||||
|
||||
// bare Z-suffixed timestamp (no TZID, how Google's quick-add events are exported) is an
|
||||
// absolute instant too -> displayed in Amsterdam local time (08:00 CET), not raw UTC (07:00)
|
||||
assert.equal(overview['2026-01-16'].tooltip, '08:00 Quick add');
|
||||
|
||||
console.log('all assertions passed');
|
||||
|
||||
Reference in New Issue
Block a user