Skip to content

Commit a1a0d11

Browse files
committed
test(ui): the root docs leg proves itself on a fixture page; drop the retired guide from the markdown input ledger
Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ADHkmQmtHYkx1Ve9ob2ikN
1 parent c11be8a commit a1a0d11

2 files changed

Lines changed: 32 additions & 15 deletions

File tree

‎ui/scripts/__tests__/check-doc-snippet-types.test.ts‎

Lines changed: 28 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -670,20 +670,37 @@ describe('objectui#7856 — the root docs/*.md pages are in the scan set, and on
670670
it('listDocuments reaches them', () => {
671671
const documents = listDocuments(repoRoot);
672672
for (const doc of rootDocsPages(repoRoot)) expect(documents).toContain(doc);
673-
// Non-vacuous: the leg reaches a real page, not an empty directory.
674-
expect(rootDocsPages(repoRoot)).toContain('docs/app-shell-extraction-guide.md');
673+
// Non-vacuous on a fixture: the tree's one root page, the app-shell
674+
// extraction guide, was retired with the package's publishing (#25922),
675+
// so the real `docs/` holds no top-level page today and the loop above
676+
// has nothing to iterate. The leg still has to reach one when it exists.
677+
const root = tempTree({ 'docs/PAGE.md': '# top level\n' });
678+
try {
679+
expect(rootDocsPages(root)).toEqual(['docs/PAGE.md']);
680+
expect(listDocuments(root)).toContain('docs/PAGE.md');
681+
} finally {
682+
fs.rmSync(root, { recursive: true, force: true });
683+
}
675684
});
676685

677686
it('the widening judges something — the leg contributes blocks to the compiled tier', () => {
678-
// Being IN the walk is one fact; being compiled is the other, and this card
679-
// delivered both (no `UNGATED_DOCS` entry was needed — the blocks were
680-
// repaired). A leg whose pages all sat on the ledger would be visible to the
681-
// accounting and judged by nothing, which is a weaker claim than this test
682-
// makes.
683-
const state = analyze({});
684-
const leg = new Set(rootDocsPages(repoRoot));
685-
expect((state.covered as string[]).filter((d) => leg.has(d)).sort()).toEqual([...leg].sort());
686-
expect((state.compiled as { doc: string }[]).some((b) => leg.has(b.doc))).toBe(true);
687+
// Being IN the walk is one fact; being compiled is the other. A leg whose
688+
// pages all sat on the ledger would be visible to the accounting and judged
689+
// by nothing, which is a weaker claim than this test makes. Measured on a
690+
// fixture page because the real `docs/` has no top-level page since #25922;
691+
// every real page the leg reaches must still be covered.
692+
const real = new Set(rootDocsPages(repoRoot));
693+
expect((analyze({}).covered as string[]).filter((d) => real.has(d)).sort()).toEqual([...real].sort());
694+
const root = tempTree({
695+
'docs/PAGE.md': ['# T', '', `${FENCE}ts`, 'export const a = 1;', FENCE].join('\n'),
696+
});
697+
try {
698+
const state = analyze({ root, ungated: {} });
699+
expect(state.covered as string[]).toContain('docs/PAGE.md');
700+
expect((state.compiled as { doc: string }[]).some((b) => b.doc === 'docs/PAGE.md')).toBe(true);
701+
} finally {
702+
fs.rmSync(root, { recursive: true, force: true });
703+
}
687704
});
688705

689706
it('stops at the top level: a page in a subdirectory is NOT collected BY THIS LEG', () => {

‎ui/scripts/markdown-test-inputs.mjs‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -827,19 +827,19 @@ export const ADJUDICATED = new Map([
827827
[
828828
'scripts/__tests__/check-doc-links.test.ts',
829829
{
830-
reads: ['./*', 'apps/**', 'content/docs/**', 'docs/app-shell-extraction-guide.md', 'docs/adr/**', 'docs/audits/**', 'examples/**', 'packages/**'],
830+
reads: ['./*', 'apps/**', 'content/docs/**', 'docs/adr/**', 'docs/audits/**', 'examples/**', 'packages/**'],
831831
},
832832
],
833833
[
834834
'scripts/__tests__/check-doc-snippet-emitted-census.test.ts',
835835
{
836-
reads: ['README.md', 'apps/console/docs/UI_IMPROVEMENT_PROPOSAL.md', 'apps/console/docs/deployment.md', 'apps/console/docs/error-tracking.md', 'content/docs/**', 'docs/app-shell-extraction-guide.md', 'docs/adr/**', 'docs/audits/**', 'packages/**'],
836+
reads: ['README.md', 'apps/console/docs/UI_IMPROVEMENT_PROPOSAL.md', 'apps/console/docs/deployment.md', 'apps/console/docs/error-tracking.md', 'content/docs/**', 'docs/adr/**', 'docs/audits/**', 'packages/**'],
837837
},
838838
],
839839
[
840840
'scripts/__tests__/check-doc-snippet-types.test.ts',
841841
{
842-
reads: ['README.md', 'apps/console/docs/UI_IMPROVEMENT_PROPOSAL.md', 'apps/console/docs/deployment.md', 'apps/console/docs/error-tracking.md', 'content/docs/**', 'docs/app-shell-extraction-guide.md', 'docs/adr/**', 'docs/audits/**', 'packages/**'],
842+
reads: ['README.md', 'apps/console/docs/UI_IMPROVEMENT_PROPOSAL.md', 'apps/console/docs/deployment.md', 'apps/console/docs/error-tracking.md', 'content/docs/**', 'docs/adr/**', 'docs/audits/**', 'packages/**'],
843843
walker: 'markdown-tree',
844844
},
845845
],
@@ -973,7 +973,7 @@ export const ADJUDICATED = new Map([
973973
[
974974
'scripts/__tests__/dollar-dialect-alias-census.test.ts',
975975
{
976-
reads: ['./*', '.changeset/**', '.claude/skills/**', 'apps/**', 'content/docs/**', 'docs/app-shell-extraction-guide.md', 'docs/adr/**', 'docs/audits/**', 'examples/**', 'packages/**', 'patches/README.md', 'skills/objectui/**'],
976+
reads: ['./*', '.changeset/**', '.claude/skills/**', 'apps/**', 'content/docs/**', 'docs/adr/**', 'docs/audits/**', 'examples/**', 'packages/**', 'patches/README.md', 'skills/objectui/**'],
977977
},
978978
],
979979
[

0 commit comments

Comments
 (0)