Integrasi Login dan menu Dasar SIAKAD Operator dan Mahasiswa

This commit is contained in:
Ariyutta
2026-11-02 09:08:03 +07:00
parent b7a0c8705b
commit 43269095bf
68 changed files with 4287 additions and 216 deletions
+45
View File
@@ -0,0 +1,45 @@
<?php
namespace Tests\Feature\Mahasiswa;
use App\Enums\Role;
use Illuminate\Foundation\Testing\RefreshDatabase;
use PHPUnit\Framework\Attributes\DataProvider;
use Tests\TestCase;
/** Transkrip untuk akun demo (provider users): akses dan halaman dasar. Data asli diuji di LegacyTranskripTest. */
class TranskripTest extends TestCase
{
use RefreshDatabase;
/** @return array<string, array{Role}> */
public static function otherRoles(): array
{
return [
'superuser' => [Role::Superuser],
'admin' => [Role::Admin],
'operator' => [Role::Operator],
'dosen' => [Role::Dosen],
];
}
public function test_guest_is_redirected_to_login(): void
{
$this->get(route('mahasiswa.transkrip'))->assertRedirect(route('login'));
}
#[DataProvider('otherRoles')]
public function test_other_roles_are_forbidden(Role $role): void
{
$this->actingAs($this->userWithRole($role))->get(route('mahasiswa.transkrip'))->assertForbidden();
}
public function test_mahasiswa_sees_the_page(): void
{
$this->actingAs($this->userWithRole(Role::Mahasiswa))
->get(route('mahasiswa.transkrip'))
->assertOk()
->assertSee('Transkrip nilai')
->assertSee('Unduh PDF');
}
}