feat: show reset button only when filters are actively applied

This commit is contained in:
Wahyudin
2026-10-13 16:41:53 +07:00
parent b6692afb57
commit 3bd7731e7c
3 changed files with 30 additions and 13 deletions
+20
View File
@@ -183,6 +183,26 @@ class VehicleActivityTest extends TestCase
$response->assertSee('Aktivitas');
}
public function test_qma_log_reset_button_shown_only_when_filtered(): void
{
$qmaAdmin = User::where('role', 'qma_admin')->first();
// 1. Unfiltered request should NOT see Reset button
$response = $this->actingAs($qmaAdmin)->get('/qma/activity-log');
$response->assertStatus(200);
$response->assertDontSee('<span>Reset</span>', false);
// 2. Request with empty filter params should NOT see Reset button
$responseEmpty = $this->actingAs($qmaAdmin)->get('/qma/activity-log?search=&direction=&gate_id=');
$responseEmpty->assertStatus(200);
$responseEmpty->assertDontSee('<span>Reset</span>', false);
// 3. Request with active filter should see Reset button
$responseFiltered = $this->actingAs($qmaAdmin)->get('/qma/activity-log?direction=in');
$responseFiltered->assertStatus(200);
$responseFiltered->assertSee('<span>Reset</span>', false);
}
public function test_admin_pg_can_store_security_guard_and_creates_login_account(): void
{
$adminPg = User::where('role', 'pg_admin')->first();