diff --git a/resources/views/widgets/userAccount.blade.php b/resources/views/widgets/userAccount.blade.php index b002f8d..03a050e 100644 --- a/resources/views/widgets/userAccount.blade.php +++ b/resources/views/widgets/userAccount.blade.php @@ -1,5 +1,5 @@
- {{ $user->getDisplayName() }} + @if($user instanceof \Kontenta\Kontour\Contracts\AdminUser){{ $user->getDisplayName() }}@endif
{{ csrf_field() }} diff --git a/tests/Feature/AuthenticationTest.php b/tests/Feature/AuthenticationTest.php index b7bee2f..1c13d26 100644 --- a/tests/Feature/AuthenticationTest.php +++ b/tests/Feature/AuthenticationTest.php @@ -74,6 +74,24 @@ public function test_index_route() { $response->assertSuccessful(); } + public function test_admin_user_account_widget() + { + $routeManager = $this->app->make(\Kontenta\Kontour\Contracts\AdminRouteManager::class); + $response = $this->actingAs($this->user)->get($routeManager->indexUrl()); + $response->assertSee('
'); + $response->assertSee($this->user->getDisplayName()); + $response->assertSee(''); + } + + public function test_user_account_widget() + { + $routeManager = $this->app->make(\Kontenta\Kontour\Contracts\AdminRouteManager::class); + $user = new \Illuminate\Foundation\Auth\User(); + $response = $this->actingAs($user)->get($routeManager->indexUrl()); + $response->assertSee('
'); + $response->assertSee(''); + } + public function test_logout() { /** diff --git a/tests/Feature/UserlandControllerTest.php b/tests/Feature/UserlandControllerTest.php index 1793c86..490072e 100644 --- a/tests/Feature/UserlandControllerTest.php +++ b/tests/Feature/UserlandControllerTest.php @@ -51,14 +51,6 @@ public function test_menu_widget() $response->assertSee('Userland Tool'); } - public function test_user_account_widget() - { - $response = $this->actingAs($this->user)->get(route('userland.index')); - $response->assertSee('
'); - $response->assertSee($this->user->getDisplayName()); - $response->assertSee(''); - } - public function test_recent_visits_widgets() { $otherUser = factory(User::class)->create();