X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/5420f3451c669c57cf1e1ce3157bb0f88ac42b61..refs/pull/2902/head:/tests/User/UserProfileTest.php diff --git a/tests/User/UserProfileTest.php b/tests/User/UserProfileTest.php index a5db83c48..859a036e0 100644 --- a/tests/User/UserProfileTest.php +++ b/tests/User/UserProfileTest.php @@ -1,4 +1,6 @@ -see($newUser->name); } + public function test_profile_has_search_links_in_created_entity_lists() + { + $user = $this->getEditor(); + $resp = $this->actingAs($this->getAdmin())->visit('/user/' . $user->slug); + + $expectedLinks = [ + '/search?term=%7Bcreated_by%3A' . $user->slug . '%7D+%7Btype%3Apage%7D', + '/search?term=%7Bcreated_by%3A' . $user->slug . '%7D+%7Btype%3Achapter%7D', + '/search?term=%7Bcreated_by%3A' . $user->slug . '%7D+%7Btype%3Abook%7D', + '/search?term=%7Bcreated_by%3A' . $user->slug . '%7D+%7Btype%3Abookshelf%7D', + ]; + + foreach ($expectedLinks as $link) { + $resp->seeInElement('[href$="' . $link . '"]', 'View All'); + } + } + public function test_guest_profile_shows_limited_form() { $this->asAdmin() @@ -141,5 +160,4 @@ class UserProfileTest extends BrowserKitTest ->pageNotHasElement('.content-wrap .entity-list-item') ->see('List View'); } - }