Is it possible to test a multiple select form?

Test body:
it('can create', function () {
    $tags = Tag::factory()->count(6)->create(); 
    $newData = Post::factory()->make();
 
    livewire(PostResource\Pages\CreatePost::class)
        ->fillForm([
            'tags' => $tags->keys(),
            'title' => $newData->title,
            // other fields ...
        ])
        ->call('create')

    // $this->assertDatabaseHas(...);
});

I have relation like https://laravel.com/docs/10.x/eloquent-relationships#many-to-many-polymorphic-relations

My filament form body:
Forms\Components\Select::make('tags')
  ->relationship('tags', 'name')
  ->multiple()
  ->preload()


When I try to run the test, I get the error: SQLSTATE[HY093]: Invalid parameter number: parameter was not defined
Laravel is a PHP web application framework with expressive, elegant syntax. We’ve already laid the foundation — freeing you to create without sweating the small things.
Was this page helpful?