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

Default templates: Cleaned up ux, added case for added endpoint

Cleaned up and updated page picker a bit, allowing longer names to show,
clicking through to item without triggering popup, and updated to use
hidden attributes instead of styles.

Added phpunit tests to cover supporting entity-selector-templates
endpoint.
This commit is contained in:
Dan Brown
2023-12-12 15:38:09 +00:00
parent d75eb06777
commit 2081a783f3
6 changed files with 47 additions and 16 deletions

View File

@ -252,6 +252,31 @@ class EntitySearchTest extends TestCase
$this->withHtml($resp)->assertElementContains($baseSelector, "You don't have the required permissions to select this item");
}
public function test_entity_template_selector_search()
{
$templatePage = $this->entities->newPage(['name' => 'Template search test', 'html' => 'template test']);
$templatePage->template = true;
$templatePage->save();
$nonTemplatePage = $this->entities->newPage(['name' => 'Nontemplate page', 'html' => 'nontemplate', 'template' => false]);
// Visit both to make popular
$this->asEditor()->get($templatePage->getUrl());
$this->asEditor()->get($nonTemplatePage->getUrl());
$normalSearch = $this->get('/search/entity-selector-templates?term=test');
$normalSearch->assertSee($templatePage->name);
$normalSearch->assertDontSee($nonTemplatePage->name);
$normalSearch = $this->get('/search/entity-selector-templates?term=beans');
$normalSearch->assertDontSee($templatePage->name);
$normalSearch->assertDontSee($nonTemplatePage->name);
$defaultListTest = $this->get('/search/entity-selector-templates');
$defaultListTest->assertSee($templatePage->name);
$defaultListTest->assertDontSee($nonTemplatePage->name);
}
public function test_sibling_search_for_pages()
{
$chapter = $this->entities->chapterHasPages();