F
Filament6mo 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
LeandroFerreira6mo ago
what would you test, the action?
shabxs
shabxsOP6mo ago
I wanted to test assertCanSeeTableRecords() assertCanNotSeeTableRecords() on all available tabs
sfrigzs
sfrigzs6mo ago
Hi @shabxs, were you able to test it? I'm trying here, but without success.
Solution
Kenneth Sese
Kenneth Sese6mo 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
sfrigzs6mo ago
Thank you, it works fine!
Want results from more Discord servers?
Add your server