]> BookStack Code Mirror - bookstack/commitdiff
Added test for includes on book export
authorDan Brown <redacted>
Sat, 26 Sep 2020 15:54:24 +0000 (16:54 +0100)
committerDan Brown <redacted>
Sat, 26 Sep 2020 15:54:24 +0000 (16:54 +0100)
Related to #2227

tests/Entity/PageContentTest.php

index d3b6224c4192b653586c55644154c0d4f62f8074..69b46b06e4e73b43bbfa290dd93faa9716977107 100644 (file)
@@ -71,6 +71,25 @@ class PageContentTest extends TestCase
         $pageResp->assertSee($content);
     }
 
+    public function test_page_includes_rendered_on_book_export()
+    {
+        $page = Page::query()->first();
+        $secondPage = Page::query()
+            ->where('book_id', '!=', $page->book_id)
+            ->first();
+
+        $content = '<p id="bkmrk-meow">my cat is awesome and scratchy</p>';
+        $secondPage->html = $content;
+        $secondPage->save();
+
+        $page->html = "{{@{$secondPage->id}#bkmrk-meow}}";
+        $page->save();
+
+        $this->asEditor();
+        $htmlContent = $this->get($page->book->getUrl('/export/html'));
+        $htmlContent->assertSee('my cat is awesome and scratchy');
+    }
+
     public function test_page_content_scripts_removed_by_default()
     {
         $this->asEditor();
Morty Proxy This is a proxified and sanitized view of the page, visit original site.