From 3c8a1353ff412af6f47e5f1d03ec4fa90e2cfe4c Mon Sep 17 00:00:00 2001 From: "pulse-triage[bot]" <249995291+pulse-triage[bot]@users.noreply.github.com> Date: Sun, 29 Nov 2026 03:09:10 +0000 Subject: [PATCH] Route secondary doc renders through createGuideFixture in 3 doc tests Completes createGuideFixture conversion for agentObserverGuide.test.ts, recoveryBackupScopeDocs.test.ts, and temperatureFAQ.test.ts so secondary cross-guide renders reuse the per-suite fixture cache instead of calling removed renderDocMarkdown directly. Contract-Neutral: Test-only fix completing fixture helper migration in three doc unit test files. Change-source: pulse-maintainer --- .../docs/__tests__/agentObserverGuide.test.ts | 3 +-- .../docs/__tests__/recoveryBackupScopeDocs.test.ts | 3 +-- .../features/docs/__tests__/temperatureFAQ.test.ts | 12 ++---------- 3 files changed, 4 insertions(+), 14 deletions(-) diff --git a/frontend-modern/src/features/docs/__tests__/agentObserverGuide.test.ts b/frontend-modern/src/features/docs/__tests__/agentObserverGuide.test.ts index 9c7d09e81c..4ae07a222a 100644 --- a/frontend-modern/src/features/docs/__tests__/agentObserverGuide.test.ts +++ b/frontend-modern/src/features/docs/__tests__/agentObserverGuide.test.ts @@ -70,8 +70,7 @@ describe('Agent observer trust and API-access choice', () => { for (const [doc, anchor] of targets) { const href = doc === 'UNIFIED_AGENT' ? `#${anchor}` : `/docs/${doc}#${anchor}`; expect(section.querySelector(`a[href="${href}"]`)).not.toBeNull(); - const article = document.createElement('article'); - article.innerHTML = renderDocMarkdown(readDoc(doc), doc); + const article = renderGuide(doc); expect(article.querySelector(`#${anchor}`)).not.toBeNull(); } expect(readFileSync(path.join(frontendRoot, 'public/docs/UNIFIED_AGENT.md'), 'utf8')).toBe( diff --git a/frontend-modern/src/features/docs/__tests__/recoveryBackupScopeDocs.test.ts b/frontend-modern/src/features/docs/__tests__/recoveryBackupScopeDocs.test.ts index 8cbf6a7230..1b22d32b67 100644 --- a/frontend-modern/src/features/docs/__tests__/recoveryBackupScopeDocs.test.ts +++ b/frontend-modern/src/features/docs/__tests__/recoveryBackupScopeDocs.test.ts @@ -102,8 +102,7 @@ describe('Recovery backup scope guidance', () => { ['AUTO_UPDATE', 'what-an-update-snapshot-contains'], ]) { expect(article.querySelector(`a[href="/docs/${name}#${anchor}"]`)).not.toBeNull(); - const target = document.createElement('article'); - target.innerHTML = renderDocMarkdown(readDoc(`${name}.md`), name); + const target = renderGuide(name); expect(target.querySelector(`#${anchor}`)).not.toBeNull(); } expect(article.querySelector('a[href="#where-to-look"]')).not.toBeNull(); diff --git a/frontend-modern/src/features/docs/__tests__/temperatureFAQ.test.ts b/frontend-modern/src/features/docs/__tests__/temperatureFAQ.test.ts index 550c42e0c5..ad1d13fe89 100644 --- a/frontend-modern/src/features/docs/__tests__/temperatureFAQ.test.ts +++ b/frontend-modern/src/features/docs/__tests__/temperatureFAQ.test.ts @@ -65,11 +65,7 @@ describe('shipped temperature FAQ', () => { '/docs/TEMPERATURE_MONITORING#recommended-pulse-agent-proxmox', '/docs/TEMPERATURE_MONITORING', ]); - const guide = document.createElement('article'); - guide.innerHTML = renderDocMarkdown( - readFileSync(path.join(servedDocs, 'TEMPERATURE_MONITORING.md'), 'utf8'), - 'TEMPERATURE_MONITORING', - ); + const guide = renderGuide('TEMPERATURE_MONITORING'); for (const link of links) { const fragment = link.getAttribute('href')!.split('#')[1]; if (fragment) expect(guide.querySelector(`#${fragment}`)).not.toBeNull(); @@ -101,11 +97,7 @@ describe('shipped temperature FAQ', () => { }); it('makes the existing extra-sensor view findable without promising battery alerts', () => { - const guide = document.createElement('article'); - guide.innerHTML = renderDocMarkdown( - readFileSync(path.join(servedDocs, 'TEMPERATURE_MONITORING.md'), 'utf8'), - 'TEMPERATURE_MONITORING', - ); + const guide = renderGuide('TEMPERATURE_MONITORING'); const heading = guide.querySelector('#other-linux-sensors-and-fan-readings'); expect(heading).not.toBeNull(); const section = document.createElement('section');