generated from rawilk/package-skeleton-laravel
-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use Filament\Actions\Concerns\InteractsWithActions; | ||
use Filament\Actions\Contracts\HasActions; | ||
use Filament\Forms\Concerns\InteractsWithForms; | ||
use Filament\Forms\Contracts\HasForms; | ||
use Filament\Forms\Form; | ||
use Livewire\Component; | ||
use Rawilk\FilamentPasswordInput\Password; | ||
|
||
use function Pest\Livewire\livewire; | ||
|
||
it('can be rendered', function () { | ||
$component = new class extends Component implements HasActions, HasForms | ||
{ | ||
use InteractsWithActions; | ||
use InteractsWithForms; | ||
|
||
public function form(Form $form): Form | ||
{ | ||
return $form | ||
->schema([ | ||
Password::make('password') | ||
->copyable() | ||
->regeneratePassword(), | ||
]); | ||
} | ||
|
||
public function render(): string | ||
{ | ||
return <<<'HTML' | ||
<div>{{ $this->form }}</div> | ||
HTML; | ||
} | ||
}; | ||
|
||
livewire($component::class)->assertSuccessful(); | ||
}); |