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

Searching: Added negation support to UI and term handling

Updated/added tests to cover.
Support for actual search queries still remains.
This commit is contained in:
Dan Brown
2024-10-03 15:59:50 +01:00
parent 177cfd72bf
commit 93c677a6a9
11 changed files with 252 additions and 96 deletions

View File

@@ -545,11 +545,10 @@ class EntitySearchTest extends TestCase
$search->assertSee($page->getUrl(), false);
}
public function test_searches_with_user_filters_adds_them_into_advanced_search_form()
public function test_searches_with_terms_without_controls_includes_them_in_extras()
{
$resp = $this->asEditor()->get('/search?term=' . urlencode('test {updated_by:dan} {created_by:dan}'));
$this->withHtml($resp)->assertElementExists('form input[name="filters[updated_by]"][value="dan"]');
$this->withHtml($resp)->assertElementExists('form input[name="filters[created_by]"][value="dan"]');
$resp = $this->asEditor()->get('/search?term=' . urlencode('test {updated_by:dan} {created_by:dan} -{viewed_by_me} -[a=b] -"dog"'));
$this->withHtml($resp)->assertFieldHasValue('extras', '{updated_by:dan} {created_by:dan} -"dog" -[a=b] -{viewed_by_me}');
}
public function test_searches_with_user_filters_using_me_adds_them_into_advanced_search_form()