-
+
@include('partials/loading-icon')
diff --git a/tests/Entity/EntitySearchTest.php b/tests/Entity/EntitySearchTest.php
index 6b313e7b8..a9d9bc047 100644
--- a/tests/Entity/EntitySearchTest.php
+++ b/tests/Entity/EntitySearchTest.php
@@ -82,4 +82,14 @@ class EntitySearchTest extends TestCase
$this->asAdmin()->visit('/search/books?term=' . $book->name)
->see('Book Search Results')->see('.entity-list', $book->name);
}
+
+ public function test_ajax_entity_search()
+ {
+ $page = \BookStack\Page::all()->last();
+ $notVisitedPage = \BookStack\Page::first();
+ $this->visit($page->getUrl());
+ $this->asAdmin()->visit('/ajax/search/entities?term=' . $page->name)->see('.entity-list', $page->name);
+ $this->asAdmin()->visit('/ajax/search/entities?types=book&term=' . $page->name)->dontSee('.entity-list', $page->name);
+ $this->asAdmin()->visit('/ajax/search/entities')->see('.entity-list', $page->name)->dontSee($notVisitedPage->name);
+ }
}
diff --git a/tests/Entity/SortTest.php b/tests/Entity/SortTest.php
index 8792a0a06..2f2f9109d 100644
--- a/tests/Entity/SortTest.php
+++ b/tests/Entity/SortTest.php
@@ -22,4 +22,22 @@ class SortTest extends TestCase
->dontSee($draft->name);
}
+ public function test_page_move()
+ {
+ $page = \BookStack\Page::first();
+ $currentBook = $page->book;
+ $newBook = \BookStack\Book::where('id', '!=', $currentBook->id)->first();
+ $this->asAdmin()->visit($page->getUrl() . '/move')
+ ->see('Move Page')->see($page->name)
+ ->type('book:' . $newBook->id, 'entity_selection')->press('Move Page');
+
+ $page = \BookStack\Page::find($page->id);
+ $this->seePageIs($page->getUrl());
+ $this->assertTrue($page->book->id == $newBook->id, 'Page book is now the new book');
+
+ $this->visit($newBook->getUrl())
+ ->seeInNthElement('.activity-list-item', 0, 'moved page')
+ ->seeInNthElement('.activity-list-item', 0, $page->name);
+ }
+
}
\ No newline at end of file