From 944bcf8b0ca892d446095e4829dfe341bad950d6 Mon Sep 17 00:00:00 2001 From: quality <280983584+hivecommons-hive[bot]@users.noreply.github.com> Date: Tue, 20 Oct 2026 02:24:51 -0400 Subject: [PATCH] test: pin GroupLinkStatus's inconclusive-recheck rule against false drift check-community-group-links.mjs writes archived:null / reachable:null when a recheck is inconclusive and no previous report carries a status forward, and documents that both consumers read null as healthy. GroupLinkStatus encodes that with the strict second operand of its stale filter, but every fixture in this file and under tests/e2e/fixtures/ sets both fields to a boolean, so relaxing the comparison to !group.reachable kept the suite green while naming an unreachable-this-run group as archived or unreachable on /community. Adds the three null-state cases: an inconclusive group raises no warning, an unknown archived flag alone raises no warning, and a genuinely archived group is still named with singular wording when a sibling is inconclusive. Signed-off-by: quality <280983584+hivecommons-hive[bot]@users.noreply.github.com> --- tests/group-link-status.test.mjs | 52 ++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/tests/group-link-status.test.mjs b/tests/group-link-status.test.mjs index f19dd43d..541a159c 100644 --- a/tests/group-link-status.test.mjs +++ b/tests/group-link-status.test.mjs @@ -114,6 +114,58 @@ test('an unreachable upstream repository is named in the warning', async () => { assert.match(text, /Research User Group has an archived or unreachable/); }); +// `npm run check:community-group-links` writes `archived: null` / +// `reachable: null` for a group whose recheck came back inconclusive -- a +// network error, a rejected token, an API outage -- when no previous report +// carries a known status forward. Both consumers read null as healthy on +// purpose: scripts/check-community-group-links.mjs says so where it writes +// the value, and scripts/validate-community-groups.mjs warns only on the +// strict `=== true` / `=== false` comparisons. +// +// The filter here has to make the same distinction (`group.archived || +// group.reachable === false`), and nothing pinned it: every fixture in this +// file and in tests/e2e/fixtures/** sets both fields to a boolean, so +// relaxing the strict comparison to `!group.reachable` would keep the whole +// suite green while telling readers that a group nobody could check is +// archived or unreachable. +test('an inconclusive recheck is not reported as drift', async () => { + const text = textOf( + await renderWith({ + generatedAt: '2026-03-04T05:06:07.000Z', + groups: [group({ archived: null, reachable: null })], + }), + ); + assert.doesNotMatch(text, /archived or unreachable/); + assert.doesNotMatch(text, /Research User Group/); +}); + +test('an unknown archived flag alone is not reported as drift', async () => { + const text = textOf( + await renderWith({ + generatedAt: '2026-03-04T05:06:07.000Z', + groups: [group({ archived: null })], + }), + ); + assert.doesNotMatch(text, /archived or unreachable/); +}); + +test('a genuinely archived group is still named when another is inconclusive', async () => { + const text = textOf( + await renderWith({ + generatedAt: '2026-03-04T05:06:07.000Z', + groups: [ + group({ archived: null, reachable: null }), + group({ slug: 'telecom', name: 'Telecom User Group', archived: true }), + ], + }), + ); + assert.match( + text, + /Telecom User Group has an archived or unreachable upstream repository/, + ); + assert.doesNotMatch(text, /Research User Group/); +}); + test('two drifted groups are listed together with plural wording', async () => { const text = textOf( await renderWith({