© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•11mo ago•
12 replies
David | Fortune Validator

getTable() on null on Pest Test

Hi all

I need some help with some table tests if anyone can spare a few minute please.

I am getting:
Error: Call to a member function getTable() on null
Error: Call to a member function getTable() on null



it('can render post titles', function () {
    \App\Models\Client::factory()->count(10)->create();

    livewire(\App\Filament\Clusters\Contacts\Resources\ClientResource\Pages\ListClients::class)
        ->assertCanRenderTableColumn('name');
});
it('can render post titles', function () {
    \App\Models\Client::factory()->count(10)->create();

    livewire(\App\Filament\Clusters\Contacts\Resources\ClientResource\Pages\ListClients::class)
        ->assertCanRenderTableColumn('name');
});


I must say I am very new to tests. I have used the example on the filamentdocs https://filamentphp.com/docs/3.x/tables/testing

The page itself loads okay and shows results.

Any advice?


EDIT: another example:
it('shows results', function () {
    $posts = \App\Models\Client::factory()->count(4)->create();

    livewire(\App\Filament\Clusters\Contacts\Resources\ClientResource\Pages\ListClients::class)
        ->assertCanSeeTableRecords($posts)
        ->assertCountTableRecords(4);
});
it('shows results', function () {
    $posts = \App\Models\Client::factory()->count(4)->create();

    livewire(\App\Filament\Clusters\Contacts\Resources\ClientResource\Pages\ListClients::class)
        ->assertCanSeeTableRecords($posts)
        ->assertCountTableRecords(4);
});


gives
Error: Call to a member function getTableRecordKey() on null
Error: Call to a member function getTableRecordKey() on null
Testing - Tables - Filament
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

#fileupload #test #pest
FilamentFFilament / ❓┊help
13mo ago
Test authentication with Pest
FilamentFFilament / ❓┊help
2y ago
Field is hidden test - Pest
FilamentFFilament / ❓┊help
11mo ago
How to increase Pest test coverage
FilamentFFilament / ❓┊help
2y ago