->see('Chapter Search Results')->seeInElement('.entity-list', $chapter->name);
}
+ public function test_search_quote_term_preparation()
+ {
+ $termString = '"192" cat "dog hat"';
+ $repo = $this->app[\BookStack\Repos\EntityRepo::class];
+ $preparedTerms = $repo->prepareSearchTerms($termString);
+ $this->assertTrue($preparedTerms === ['"192"','"dog hat"', 'cat']);
+ }
+
public function test_books_search_listing()
{
$book = \BookStack\Book::all()->last();
->see('Book Search Results')->see('.entity-list', $book->name);
}
+ public function test_searching_hypen_doesnt_break()
+ {
+ $this->visit('/search/all?term=cat+-')
+ ->seeStatusCode(200);
+ }
+
public function test_ajax_entity_search()
{
$page = \BookStack\Page::all()->last();