refactor observers, fix policy, add feature tests

This commit is contained in:
2026-05-07 05:31:22 +07:00
parent f5615038b4
commit 8cb9c0eb96
9 changed files with 216 additions and 36 deletions
+9 -1
View File
@@ -3,8 +3,16 @@
namespace Tests;
use Illuminate\Foundation\Testing\TestCase as BaseTestCase;
use Spatie\Permission\Models\Role;
abstract class TestCase extends BaseTestCase
{
//
protected function setUp(): void
{
parent::setUp();
// Seed roles yang dibutuhkan observer
foreach (['anggota', 'ketua', 'bendahara', 'pengurus', 'auditor', 'super_admin'] as $role) {
Role::firstOrCreate(['name' => $role, 'guard_name' => 'web']);
}
}
}