Pesting form builder with upload file

I am trying to test upload the file in my order. That gives me an error foreach() argument must be of type array|object, string given. Here is my code.
Forms\Components\FileUpload::make('screenshot')
    ->required()
    ->label(__('Screenshot'))
    ->directory('transaction-images')
    ->columnSpanFull(),

test('user can order the product', function () {
    $this->actingAs(User::factory()->create());

    $file = Illuminate\Http\UploadedFile::fake()->create('screenshot.jpg');

    livewire('order.create')
        ->fillForm([
            'url' => fake()->url(),
            'screenshot' => $file->name,
        ]);
});
Screenshot_2024-06-07_220104.png
Solution
It's working now. That does not belong with version breaks
Was this page helpful?