Skip to content

Commit

Permalink
Add a test for when heading permalinks are disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
caendesilva committed Dec 1, 2024
1 parent 358c799 commit 279d91d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions packages/framework/tests/Feature/Services/HydeSmartDocsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,16 @@ public function renderHeader(): HtmlString
$this->assertStringContainsString('<p>Hello world.</p>', $rendered);
}

public function testClassCanParseDocumentWithDisabledPermalinks()
{
config(['markdown.permalinks.enabled' => false]);

$article = $this->makeArticle("# Header Content \n\n Body Content");

$this->assertSame('<h1>Header Content</h1>', $article->renderHeader()->toHtml());
$this->assertSame('<p>Body Content</p>', $article->renderBody()->toHtml());
}

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

0 comments on commit 279d91d

Please sign in to comment.