1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2026-01-03 23:42:28 +03:00

Searching: Fixed some form search issues

- Form was not retaining certain filters
- Form request handling of entity type set wrong filter name
Added test to cover.
This commit is contained in:
Dan Brown
2024-10-05 14:47:00 +01:00
parent c314a60a16
commit 51287d545b
3 changed files with 20 additions and 4 deletions

View File

@@ -573,8 +573,8 @@ class EntitySearchTest extends TestCase
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} -{viewed_by_me} -[a=b] -"dog"'));
$this->withHtml($resp)->assertFieldHasValue('extras', '{updated_by:dan} {created_by:dan} -"dog" -[a=b] -{viewed_by_me}');
$resp = $this->asEditor()->get('/search?term=' . urlencode('test {updated_by:dan} {created_by:dan} -{viewed_by_me} -[a=b] -"dog" {is_template} {sort_by:last_commented}'));
$this->withHtml($resp)->assertFieldHasValue('extras', '{updated_by:dan} {created_by:dan} {is_template} {sort_by:last_commented} -"dog" -[a=b] -{viewed_by_me}');
}
public function test_negated_searches_dont_show_in_inputs()