© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•13mo ago•
3 replies
Aethyrion

Testing pagination on relation manager

Is it possible to test for subsequent table pages on a relation manager? I thought this test might have worked but it's failing:

public function test_the_next_page_of_addresses_can_be_seen(): void
{
    $customer = Customer::factory()
        ->has(CustomerAddress::factory()->count(20), 'addresses')
        ->create();

    $livewire = Livewire::test(
        name: AddressesRelationManager::class,
        params: [
            'ownerRecord' => $customer,
            'pageClass' => EditCustomer::class,
        ],
    );

    $livewire
        ->call('gotoPage', 2)
        ->assertCanSeeTableRecords($customer->addresses->slice(offset: 10, length: 10))
    ;
}
public function test_the_next_page_of_addresses_can_be_seen(): void
{
    $customer = Customer::factory()
        ->has(CustomerAddress::factory()->count(20), 'addresses')
        ->create();

    $livewire = Livewire::test(
        name: AddressesRelationManager::class,
        params: [
            'ownerRecord' => $customer,
            'pageClass' => EditCustomer::class,
        ],
    );

    $livewire
        ->call('gotoPage', 2)
        ->assertCanSeeTableRecords($customer->addresses->slice(offset: 10, length: 10))
    ;
}
image.png
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

Testing relation manager actions
FilamentFFilament / ❓┊help
12mo ago
Testing Filament Relation Manager
FilamentFFilament / ❓┊help
2y ago
Testing Relation Managers
FilamentFFilament / ❓┊help
17mo ago
Testing relation managers
FilamentFFilament / ❓┊help
2y ago