]> BookStack Code Mirror - bookstack/blobdiff - tests/User/UserProfileTest.php
Fixes for CodeStyle vol.2
[bookstack] / tests / User / UserProfileTest.php
index a5db83c48e78816ed4af15402f8c5185209272b5..859a036e0e4a9a06653aa2da6bfff2aac7fe18fc 100644 (file)
@@ -1,4 +1,6 @@
-<?php namespace Tests\User;
+<?php
+
+namespace Tests\User;
 
 use Activity;
 use BookStack\Actions\ActivityType;
@@ -83,6 +85,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()
@@ -141,5 +160,4 @@ class UserProfileTest extends BrowserKitTest
             ->pageNotHasElement('.content-wrap .entity-list-item')
             ->see('List View');
     }
-
 }