Implement superadmin audit log for mutations
This commit is contained in:
@@ -5,6 +5,7 @@ namespace Tests\Feature;
|
||||
use App\Filament\Clusters\DailyOps\Resources\Photos\Pages\ListPhotos;
|
||||
use App\Models\Event;
|
||||
use App\Models\Photo;
|
||||
use App\Models\SuperAdminActionLog;
|
||||
use App\Models\Tenant;
|
||||
use App\Models\User;
|
||||
use Filament\Actions\Testing\TestAction;
|
||||
@@ -40,6 +41,10 @@ class PhotoModerationQueueTest extends TestCase
|
||||
$this->assertSame('Looks good.', $photo->moderation_notes);
|
||||
$this->assertNotNull($photo->moderated_at);
|
||||
$this->assertSame($user->id, $photo->moderated_by);
|
||||
$this->assertTrue(SuperAdminActionLog::query()
|
||||
->where('action', 'photo.approved')
|
||||
->where('subject_id', $photo->id)
|
||||
->exists());
|
||||
}
|
||||
|
||||
public function test_superadmin_can_bulk_reject_pending_photos(): void
|
||||
@@ -74,6 +79,10 @@ class PhotoModerationQueueTest extends TestCase
|
||||
$this->assertNotNull($photoB->moderated_at);
|
||||
$this->assertSame($user->id, $photoA->moderated_by);
|
||||
$this->assertSame($user->id, $photoB->moderated_by);
|
||||
$this->assertTrue(SuperAdminActionLog::query()
|
||||
->where('action', 'photo.rejected')
|
||||
->whereIn('subject_id', [$photoA->id, $photoB->id])
|
||||
->count() === 2);
|
||||
}
|
||||
|
||||
private function bootSuperAdminPanel(User $user): void
|
||||
|
||||
Reference in New Issue
Block a user