feat: add auth navbar and role-aware UI to all views

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
GuavaPopper
2026-06-02 19:34:17 +07:00
parent f609c1efa7
commit 5683cd3b0e
4 changed files with 367 additions and 96 deletions
+23
View File
@@ -105,4 +105,27 @@ class AuthTest extends TestCase
$response = $this->actingAs($viewer)->delete('/api/ibadah/999');
$response->assertStatus(403);
}
public function test_data_page_shows_user_name_and_logout(): void
{
$this->artisan('db:seed', ['--class' => 'RolesAndAdminSeeder']);
$user = User::where('email', 'admin@webgis.local')->first();
$response = $this->actingAs($user)->get('/data');
$response->assertStatus(200);
$response->assertSee('Keluar');
$response->assertSee($user->name);
}
public function test_map_page_passes_user_role_to_js(): void
{
$this->artisan('db:seed', ['--class' => 'RolesAndAdminSeeder']);
$user = User::where('email', 'admin@webgis.local')->first();
$response = $this->actingAs($user)->get('/map');
$response->assertStatus(200);
$response->assertSee("authUserRole = 'administrator'", false);
}
}