beforeEach(function () { $org = Organization::factory()->create(); $users = User::factory()->create(); $adminRole = Role::create(['name' => 'super_admin', 'organization_id' => 1]); setPermissionsTeamId($org->id); $users->organization()->associate($org); $users->assignRole($adminRole); Filament::setCurrentPanel(Filament::getPanel('admin')); actingAs(User::first()); Gate::before(function (User $user) { return $user->where('super_admin') ? true : null; }); }); it('can display a page', function () { $user = User::factory()->count(3)->create(); // dd($user->count()); livewire(ListUsers::class) ->assertCanSeeTableRecords($user) ->assertCountTableRecords($user->count()) ->assertOk(); });