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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user