From: Dan Brown Date: Tue, 12 Dec 2023 15:41:56 +0000 (+0000) Subject: Default templates: Added permission checks to selector test X-Git-Tag: v23.12~1^2~9^2~1 X-Git-Url: http://source.bookstackapp.com/bookstack/commitdiff_plain/2f3806244cbbe589d3130efcef038b2a62f05afa Default templates: Added permission checks to selector test --- diff --git a/tests/Entity/EntitySearchTest.php b/tests/Entity/EntitySearchTest.php index 7841a255e..9b77a32ab 100644 --- a/tests/Entity/EntitySearchTest.php +++ b/tests/Entity/EntitySearchTest.php @@ -262,7 +262,7 @@ class EntitySearchTest extends TestCase // Visit both to make popular $this->asEditor()->get($templatePage->getUrl()); - $this->asEditor()->get($nonTemplatePage->getUrl()); + $this->get($nonTemplatePage->getUrl()); $normalSearch = $this->get('/search/entity-selector-templates?term=test'); $normalSearch->assertSee($templatePage->name); @@ -275,6 +275,14 @@ class EntitySearchTest extends TestCase $defaultListTest = $this->get('/search/entity-selector-templates'); $defaultListTest->assertSee($templatePage->name); $defaultListTest->assertDontSee($nonTemplatePage->name); + + $this->permissions->disableEntityInheritedPermissions($templatePage); + + $normalSearch = $this->get('/search/entity-selector-templates?term=test'); + $normalSearch->assertDontSee($templatePage->name); + + $defaultListTest = $this->get('/search/entity-selector-templates'); + $defaultListTest->assertDontSee($templatePage->name); } public function test_sibling_search_for_pages()