Skip to content

Commit 50b0696

Browse files
committed
test: assert release navigation shape instead of pinned versions
The Release & CI navigation assertion pinned the exact release-notes page list, so every release that added a docs/releases/<version> page broke it. The tooling lane is not selected by a docs-only release PR's change classification, so the break landed green and first appeared on main (#133557 turned main red; #133581 rebumped the literal). Read the published versions from the English navigation instead, and keep the invariants that matter: releases/index first, version-shaped entries after it, the full tab equal to those pages plus the fixed non-release routes, no duplicates, and the zh-CN group mirroring English exactly.
1 parent 99eec0e commit 50b0696

1 file changed

Lines changed: 21 additions & 2 deletions

File tree

‎test/scripts/docs-sync-publish.test.ts‎

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,16 +174,35 @@ describe("docs-sync-publish", () => {
174174
]);
175175

176176
const releaseTab = english!.tabs.find((tab) => tab.tab === "Release & CI");
177-
const releaseRoutes = collectPages(releaseTab);
178177
const releaseNotes = collectPages(releaseTab?.groups?.[0]);
179178
expect(releaseTab?.groups?.map((group) => group.group)).toEqual([
180179
"Release notes",
181180
"Maturity",
182181
"Release process",
183182
"Testing and CI",
184183
]);
184+
// Every release adds a releases/<version> page, so read the published versions from the
185+
// navigation rather than pinning them here; only the index-first ordering and the version
186+
// route shape are invariant. Pinning the list makes this assertion fail on release PRs whose
187+
// change classification never selects this lane, so the break first lands on main.
185188
expect(releaseNotes[0]).toBe("releases/index");
186-
expect(new Set(collectPages(releaseTab))).toHaveLength(releaseRoutes.length);
189+
expect(releaseNotes.length).toBeGreaterThan(1);
190+
for (const page of releaseNotes.slice(1)) {
191+
expect(page).toMatch(/^releases\/\d{4}\.\d{1,2}\.\d+$/);
192+
}
193+
const releaseRoutes = [
194+
...releaseNotes,
195+
"maturity/scorecard",
196+
"maturity/taxonomy",
197+
"reference/RELEASING",
198+
"reference/full-release-validation",
199+
"reference/release-performance-sweep",
200+
"reference/test",
201+
"ci",
202+
"help/scripts",
203+
];
204+
expect(collectPages(releaseTab)).toEqual(releaseRoutes);
205+
expect(new Set(releaseRoutes)).toHaveLength(releaseRoutes.length);
187206

188207
const englishWithoutClawHub = {
189208
...english,

0 commit comments

Comments
 (0)