Skip to content
This repository has been archived by the owner on Oct 10, 2018. It is now read-only.

Commit

Permalink
Display UserAccountWidget in view
Browse files Browse the repository at this point in the history
  • Loading branch information
bjuppa committed Oct 4, 2018
1 parent 1e7d967 commit 66dd53e
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions resources/views/widgets/userAccount.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<section data-kontour-widget="userAccount">
</section>
1 change: 1 addition & 0 deletions src/Providers/KontourServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ protected function registerEventListeners()
protected function registerWidgets()
{
$this->registerAdminWidget($this->app->make(\Kontenta\Kontour\Contracts\MenuWidget::class), $this->app->make(\Kontenta\Kontour\Contracts\AdminViewManager::class)->navSection());
$this->registerAdminWidget($this->app->make(\Kontenta\Kontour\Contracts\UserAccountWidget::class), $this->app->make(\Kontenta\Kontour\Contracts\AdminViewManager::class)->headerSection());
}

/**
Expand Down
1 change: 1 addition & 0 deletions src/Widgets/UserAccountWidget.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Kontenta\KontourSupport\Widgets;

use Illuminate\Contracts\Auth\Access\Authorizable;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\View;
use Kontenta\Kontour\Contracts\UserAccountWidget as UserAccountWidgetContract;

Expand Down
7 changes: 7 additions & 0 deletions tests/Feature/UserlandControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,13 @@ public function test_menu_widget()
$response->assertSee('<a href="' . route('userland.index') . '">Userland Tool</a>');
}

public function test_user_account_widget()
{
$response = $this->actingAs($this->user)->get(route('userland.index'));

$response->assertSee('<section data-kontour-widget="userAccount">');
}

public function test_recent_visits_widgets()
{
$otherUser = factory(User::class)->create();
Expand Down

0 comments on commit 66dd53e

Please sign in to comment.