Skip to content

Commit eeaa56d

Browse files
committed
Fix regression test to actually exercise the lead-time bound
- candidateOccurrences(1, Date.UTC(2026, 11, 1)) generates December 2026 (month index 11), not January 2027, so the test's January-titled discussion was excluded by month mismatch alone and never reached the 300-day lead-time check it was meant to cover — a false-positive pass. - Target the January 2027 occurrence directly (from = 2027-01-01) with a sanity assertion on monthIndex, and verified by hand that the lead (374 days) is what the bound actually rejects. - Re-verified live against the real GitHub API: sync still reports "already synchronized", confirming the production matching logic was already correct and only the test needed fixing.
1 parent 426c9fd commit eeaa56d

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎.github/scripts/sync-community-call.test.mjs‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,8 @@ test('applyAgendaDiscussions ignores a month-only title created a year before th
111111
// A real example: "January Community Call" was created Jan 2026 for the
112112
// January 2026 call. Without a year in the title, it must not match the
113113
// January 2027 occurrence just because the month name lines up.
114-
const occurrences = candidateOccurrences(1, new Date(Date.UTC(2026, 11, 1)));
114+
const occurrences = candidateOccurrences(1, new Date(Date.UTC(2027, 0, 1)));
115+
assert.equal(occurrences[0].monthIndex, 0); // sanity: this is the January occurrence
115116
const updated = applyAgendaDiscussions(occurrences, [
116117
{ title: 'January Community Call', url: 'https://github.com/PowerShell/PowerShell/discussions/old-january', createdAt: '2026-01-12T17:43:03Z' },
117118
]);

0 commit comments

Comments
 (0)