]> BookStack Code Mirror - bookstack/blobdiff - tests/Entity/BookTest.php
Input WYSIWYG: Fixed up some dark mode elements
[bookstack] / tests / Entity / BookTest.php
index 3e37e61f7d7b394659ab93c14e2ed1451debcd54..3740892460b296e44b7d4c88e17afb6c7709d421 100644 (file)
@@ -278,6 +278,17 @@ class BookTest extends TestCase
         $this->assertEquals($expected, $book->description_html);
     }
 
+    public function test_show_view_displays_description_if_no_description_html_set()
+    {
+        $book = $this->entities->book();
+        $book->description_html = '';
+        $book->description = "My great\ndescription\n\nwith newlines";
+        $book->save();
+
+        $resp = $this->asEditor()->get($book->getUrl());
+        $resp->assertSee("<p>My great<br>\ndescription<br>\n<br>\nwith newlines</p>", false);
+    }
+
     public function test_show_view_has_copy_button()
     {
         $book = $this->entities->book();
@@ -307,6 +318,8 @@ class BookTest extends TestCase
 
         $resp->assertRedirect($copy->getUrl());
         $this->assertEquals($book->getDirectChildren()->count(), $copy->getDirectChildren()->count());
+
+        $this->get($copy->getUrl())->assertSee($book->description_html, false);
     }
 
     public function test_copy_does_not_copy_non_visible_content()