]> BookStack Code Mirror - bookstack/commitdiff
Add tests for creating a book and adding directly to a shelf
authorChristopher Wilkinson <redacted>
Wed, 3 Apr 2019 09:05:08 +0000 (10:05 +0100)
committerChristopher Wilkinson <redacted>
Mon, 15 Apr 2019 08:27:17 +0000 (09:27 +0100)
tests/Entity/BookShelfTest.php

index a95f31b524059def5b6eb1adb98017b6c76ba1cc..e49c247395a8959eb1f4775e8dd8f2237067d14e 100644 (file)
@@ -155,7 +155,19 @@ class BookShelfTest extends TestCase
         $shelf = Bookshelf::first();
         $resp = $this->asEditor()->get($shelf->getUrl('/create-book'));
 
-        $resp->assertSeeText('Create New Book');
+        $resp->assertSee('Create New Book');
+        $resp->assertSee($shelf->getShortName());
+
+        $testName = 'Test Book in Shelf Name';
+
+        $createBookResp = $this->asEditor()->post($shelf->getUrl('/create-book'), [
+            'name' => $testName,
+            'description' => 'Book in shelf description'
+        ]);
+
+        $resp = $this->asEditor()->get($shelf->getUrl());
+
+        $resp->assertSee($testName);
     }
 
     public function test_shelf_delete()