assertCanSeeTableRecords fails on tables with Custom data
Having issues using the assertCanSeeTableRecords when writing tests that use custom data
Error: ErrorException: Array to string conversion
Location Filament\Tables\Testing\TestsRecords line 29
Solution:Jump to solution
Yeah so i key valued the arrays in the static data and checked against those keys and it worked
so
```...
6 Replies
Maybe share some code.
Test
Error -
ErrorException: Array to string conversion
Fails at Location Filament\Tables\Testing\TestsRecords line 29
I don't know how exactly
assertCanSeeTableRecords()
works with static data. But with non-static data you pass a list of record ids. Not the full data.Solution
Yeah so i key valued the arrays in the static data and checked against those keys and it worked
so
Works π
Maybe it was just my misunderstanding of how this works but is it worth addding this to the docs somewhere?
Like under the https://filamentphp.com/docs/4.x/tables/custom-data section?
If you want to PR this, I think it belongs here: https://filamentphp.com/docs/4.x/testing/testing-tables#testing-that-a-table-can-render