F
Filament2mo ago
shabxs

Testing Filter Tabs

When Using tabs to filter the records, how can we test these filter functions.
Solution:
@shabxs @sfrigzs you can pass in the name of the tab you want to test: ```php livewire(ListOrders::class, [...
Jump to solution
5 Replies
LeandroFerreira
LeandroFerreira2mo ago
what would you test, the action?
shabxs
shabxs2mo ago
I wanted to test assertCanSeeTableRecords() assertCanNotSeeTableRecords() on all available tabs
sfrigzs
sfrigzs5w ago
Hi @shabxs, were you able to test it? I'm trying here, but without success.
Solution
Kenneth Sese
Kenneth Sese5w ago
@shabxs @sfrigzs you can pass in the name of the tab you want to test:
livewire(ListOrders::class, [
'activeTab' => 'pending',
])
->assertSuccessful()
->assertCanSeeTableRecords($pendingOrders)
livewire(ListOrders::class, [
'activeTab' => 'pending',
])
->assertSuccessful()
->assertCanSeeTableRecords($pendingOrders)
sfrigzs
sfrigzs4w ago
Thank you, it works fine!