Dev branch

This commit is contained in:
Simon Pocrnjič
2025-11-02 12:31:01 +01:00
parent 5f879c9436
commit 63e0958b66
241 changed files with 17686 additions and 7327 deletions
@@ -0,0 +1,22 @@
<?php
use App\Models\Permission;
use App\Models\Role;
use App\Models\User;
it('shows reports index', function (): void {
$user = User::factory()->create();
// grant reports-view permission
$role = Role::create(['name' => 'Reporter', 'slug' => 'reporter']);
$perm = Permission::firstOrCreate(['slug' => 'reports-view'], ['name' => 'Reports View']);
$role->permissions()->syncWithoutDetaching($perm->id);
$role->users()->syncWithoutDetaching($user->id);
$this->actingAs($user);
$response = $this->get(route('reports.index'));
$response->assertSuccessful();
$response->assertInertia(fn ($page) => $page
->component('Reports/Index')
->has('reports')
);
});