Testing a TextInputColumn
Given I have a TextInputColumn. I want to test inputing values and other behaviour.
Given I have
TextInputColumn::make('amountOrdered')->label('ordered'),
Now I want to write some tests around this. So I tried:
However this gives me an error:
Any suggestions?Solution:Jump to solution
you can use
updateTableColumnState
```php
$column = 'name';
$record = 1;...6 Replies
Based on docs, it should be
fillForm()
https://filamentphp.com/docs/3.x/forms/testing#filling-a-formHow would this work because when I do this:
I get
FAILED Tests\Feature\OrderItemTest > it can propperly increase and decrease the product stock TypeError
Filament\Resources\Pages\ListRecords::form(): Argument #1 ($form) must be of type Filament\Forms\Form, Filament\Infolists\Infolist given, called in /Users/jigalsanders/prive/weisz-watches-stock/vendor/filament/infolists/src/Concerns/InteractsWithInfolists.php on line 56
at vendor/filament/filament/src/Resources/Pages/ListRecords.php:99
95▕ default => null,
96▕ };
97▕ }
98▕
➜ 99▕ public function form(Form $form): Form
100▕ {
101▕ return static::getResource()::form($form);
102▕ }
103▕
Anyone?
Solution
you can use
updateTableColumnState
Thanks for your reply.
The column I use doesn't exist in the table but it does exist on the model.
oh wait
Maybe it does work
what does it mean? 😅
It works!!!!
Thanks soo much