© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•16mo ago•
1 reply
uendel

How to test the form of a relation manager?

I want to verifiy if one select field of my relation manager has the correct options, however I don't know how I can make this assertion. I've tried:

    livewire(RelationManager::class, ['ownerRecord' => $record, 'pageClass' => ''])
        ->assertFormFieldExists(
            'select_field',
            checkFieldUsing: function ($field) {
                $options = $field->getOptions();

                expect($options)
                    ->toHaveCount(1);

                return true;
            },
        );
    livewire(RelationManager::class, ['ownerRecord' => $record, 'pageClass' => ''])
        ->assertFormFieldExists(
            'select_field',
            checkFieldUsing: function ($field) {
                $options = $field->getOptions();

                expect($options)
                    ->toHaveCount(1);

                return true;
            },
        );


But this returns the error:

`
Argument #1 ($form) must be of type Filament\Forms\Form, Filament\Infolists\Infolist given, called in /var/www/html/vendor/filament/infolists/src/Concerns/InteractsWithInfolists.php
`
Argument #1 ($form) must be of type Filament\Forms\Form, Filament\Infolists\Infolist given, called in /var/www/html/vendor/filament/infolists/src/Concerns/InteractsWithInfolists.php


How can I test this?
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

Test relation manager
FilamentFFilament / ❓┊help
3y ago
Relation manager form
FilamentFFilament / ❓┊help
2y ago
Having a relation manager under the edit form in a modal of a relation manager
FilamentFFilament / ❓┊help
3y ago