Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
rawilk committed Jan 22, 2024
1 parent 1394910 commit ecf719d
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions tests/PasswordTest.php
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();
});

0 comments on commit ecf719d

Please sign in to comment.