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