From 279d91d70dfa727626c983aefd3a217d617131b2 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Sun, 1 Dec 2024 20:32:20 +0100 Subject: [PATCH] Add a test for when heading permalinks are disabled --- .../tests/Feature/Services/HydeSmartDocsTest.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packages/framework/tests/Feature/Services/HydeSmartDocsTest.php b/packages/framework/tests/Feature/Services/HydeSmartDocsTest.php index e22136b9b57..10c10b5326d 100644 --- a/packages/framework/tests/Feature/Services/HydeSmartDocsTest.php +++ b/packages/framework/tests/Feature/Services/HydeSmartDocsTest.php @@ -214,6 +214,16 @@ public function renderHeader(): HtmlString $this->assertStringContainsString('

Hello world.

', $rendered); } + public function testClassCanParseDocumentWithDisabledPermalinks() + { + config(['markdown.permalinks.enabled' => false]); + + $article = $this->makeArticle("# Header Content \n\n Body Content"); + + $this->assertSame('

Header Content

', $article->renderHeader()->toHtml()); + $this->assertSame('

Body Content

', $article->renderBody()->toHtml()); + } + protected function makeArticle(string $sourceFileContents = "# Foo\n\nHello world."): SemanticDocumentationArticle { $this->file('_docs/foo.md', $sourceFileContents);