toby/tests/Feature/VacationCalendarTest.php
Adrian Hopek 6af4380fe6
#108 - types of vacation request (#110)
* #108 - wip

* #108 - add icon to absence

* #108 - wip

* #108 - fix

* #108 - fix title

Co-authored-by: EwelinaLasowy <ewelina.lasowy@blumilk.pl>
2022-04-06 15:13:54 +02:00

38 lines
957 B
PHP

<?php
declare(strict_types=1);
namespace Tests\Feature;
use Illuminate\Foundation\Testing\DatabaseMigrations;
use Tests\FeatureTestCase;
use Toby\Domain\Enums\EmploymentForm;
use Toby\Eloquent\Models\User;
class VacationCalendarTest extends FeatureTestCase
{
use DatabaseMigrations;
public function testAdministrativeApproverCanDownloadTimesheet(): void
{
$administrativeApprover = User::factory()->administrativeApprover()->create();
User::factory(["employment_form" => EmploymentForm::EmploymentContract])
->count(10)
->create();
$this->actingAs($administrativeApprover)
->get("/vacation/timesheet/january")
->assertOk();
}
public function testEmployeeCannotDownloadTimesheet(): void
{
$user = User::factory()->create();
$this->actingAs($user)
->get("/vacation/timesheet/january")
->assertForbidden();
}
}