- added some test

This commit is contained in:
EwelinaLasowy
2022-03-29 10:40:51 +02:00
parent 720d2c4e7b
commit c09a1e664a
4 changed files with 242 additions and 1 deletions

View File

@@ -0,0 +1,32 @@
<?php
declare(strict_types=1);
namespace Tests\Feature;
use Illuminate\Foundation\Testing\DatabaseMigrations;
use Tests\FeatureTestCase;
use Toby\Eloquent\Models\User;
class MonthlyUsageTest extends FeatureTestCase
{
use DatabaseMigrations;
public function testAdministatorCanSeeVacationsMonthlyUsage(): void
{
$admin = User::factory()->admin()->createQuietly();
$this->actingAs($admin)
->get("/monthly-usage")
->assertOk();
}
public function testEmployeeCannotSeeVacationsMonthlyUsage(): void
{
$user = User::factory()->createQuietly();
$this->actingAs($user)
->get("/monthly-usage")
->assertForbidden();
}
}