-
Notifications
You must be signed in to change notification settings - Fork 113
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: make the avatar of the employee clickable on dashboard (#836)
- Loading branch information
Showing
4 changed files
with
41 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
tests/Unit/ViewHelpers/Dashboard/DashboardViewHelperTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
|
||
namespace Tests\Unit\ViewHelpers\Dashboard; | ||
|
||
use Carbon\Carbon; | ||
use Tests\TestCase; | ||
use App\Helpers\ImageHelper; | ||
use App\Http\ViewHelpers\Dashboard\DashboardViewHelper; | ||
use Illuminate\Foundation\Testing\DatabaseTransactions; | ||
|
||
class DashboardViewHelperTest extends TestCase | ||
{ | ||
use DatabaseTransactions; | ||
|
||
/** @test */ | ||
public function it_gets_information_about_the_employee(): void | ||
{ | ||
Carbon::setTestNow(Carbon::create(2018, 1, 1)); | ||
$michael = $this->createAdministrator(); | ||
|
||
$this->assertEquals( | ||
[ | ||
'id' => $michael->id, | ||
'name' => $michael->name, | ||
'avatar' => ImageHelper::getAvatar($michael, 55), | ||
'dashboard_view' => 'info', | ||
'can_manage_expenses' => false, | ||
'is_manager' => false, | ||
'can_manage_hr' => true, | ||
'url' => env('APP_URL') . '/' . $michael->company_id . '/employees/' . $michael->id, | ||
], | ||
DashboardViewHelper::information($michael, 'info') | ||
); | ||
} | ||
} |