diff --git a/resources/views/users/profile.blade.php b/resources/views/users/profile.blade.php index 4028b5c1d..5a76a222a 100644 --- a/resources/views/users/profile.blade.php +++ b/resources/views/users/profile.blade.php @@ -60,7 +60,7 @@

{{ trans('entities.recently_created_pages') }} @if (count($recentlyCreated['pages']) > 0) - {{ trans('common.view_all') }} + {{ trans('common.view_all') }} @endif

@if (count($recentlyCreated['pages']) > 0) @@ -74,7 +74,7 @@

{{ trans('entities.recently_created_chapters') }} @if (count($recentlyCreated['chapters']) > 0) - {{ trans('common.view_all') }} + {{ trans('common.view_all') }} @endif

@if (count($recentlyCreated['chapters']) > 0) @@ -88,7 +88,7 @@

{{ trans('entities.recently_created_books') }} @if (count($recentlyCreated['books']) > 0) - {{ trans('common.view_all') }} + {{ trans('common.view_all') }} @endif

@if (count($recentlyCreated['books']) > 0) @@ -102,7 +102,7 @@

{{ trans('entities.recently_created_shelves') }} @if (count($recentlyCreated['shelves']) > 0) - {{ trans('common.view_all') }} + {{ trans('common.view_all') }} @endif

@if (count($recentlyCreated['shelves']) > 0) diff --git a/tests/User/UserProfileTest.php b/tests/User/UserProfileTest.php index a5db83c48..c87996669 100644 --- a/tests/User/UserProfileTest.php +++ b/tests/User/UserProfileTest.php @@ -83,6 +83,23 @@ class UserProfileTest extends BrowserKitTest ->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()