1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-31 15:24:31 +03:00

Add button to add a book directly from a shelf view

This commit is contained in:
Christopher Wilkinson
2019-04-02 16:35:46 +01:00
parent c836862d89
commit faa3a8b842
5 changed files with 57 additions and 5 deletions

View File

@ -99,9 +99,11 @@ class BookShelfTest extends TestCase
{
$shelf = Bookshelf::first();
$resp = $this->asAdmin()->get($shelf->getUrl());
$resp->assertSee($shelf->getUrl('/create-book'));
$resp->assertSee($shelf->getUrl('/edit'));
$resp->assertSee($shelf->getUrl('/permissions'));
$resp->assertSee($shelf->getUrl('/delete'));
$resp->assertElementContains('a', 'Create New Book');
$resp->assertElementContains('a', 'Edit');
$resp->assertElementContains('a', 'Permissions');
$resp->assertElementContains('a', 'Delete');
@ -148,6 +150,14 @@ class BookShelfTest extends TestCase
$this->assertDatabaseHas('bookshelves_books', ['bookshelf_id' => $shelf->id, 'book_id' => $booksToInclude[1]->id]);
}
public function test_shelf_create_new_book()
{
$shelf = Bookshelf::first();
$resp = $this->asEditor()->get($shelf->getUrl('/create-book'));
$resp->assertSeeText('Create New Book');
}
public function test_shelf_delete()
{
$shelf = Bookshelf::first();