filament-tests
filament-tests copied to clipboard
A package that creates PEST tests specifically tailored for your filament resources.
Illuminate\Database\QueryException: SQLSTATE[HY000]: General error: 1 no such column: post.id for `Tables\Columns\TextColumn::make('post.id')` Related to #257
Currently the resource and page namespaces are [hardcoded in the stub](https://github.com/CodeWithDennis/filament-tests/blob/3873a8db8243059ff116074cae2f45ff82416a2a/stubs/Setup.stub#L3), so a test for a resource in a non-standard directory, or cluster, will not import the correct classes. `Filament::getResources()`...
For example ```php it('can sort column', function (string $column) { Transaction::factory(3)->create(); livewire(ListTransactions::class) ->sortTable($column) ->assertCanSeeTableRecords(Transaction::orderBy($column)->get(), inOrder: true) ->sortTable($column, 'desc') ->assertCanSeeTableRecords(Transaction::orderBy($column, 'desc')->get(), inOrder: true); })->with(['amount', 'enteredBy.name', 'created_at', 'updated_at'])->group('resource', 'page', 'index', 'table', 'column');...
- [ ] check for class (css) name - [ ] add test to confirm a tab exists
This is an attempt to massively clean up method signature. We can almost always default to `$this->resource` as it is set on `Base`, this removes the need to manually pass...
Closes #126 Generated tests example:   