Tom
Tom
FFilament
Created by JJSanders on 2/1/2024 in #❓┊help
Testing repeater
Try updating fillForm like so:
livewire(OrderResource\Pages\EditOrder::class,[
'record' => $order->id
])
->assertSee('Rij toevoegen')
->callFormComponentAction('items','add')
->fillForm([
'items' => [
[
'product_id' => $product->id,
'quantity' => 5,
'type' => OrderGoal::Stock,
'reference' => 12345
]
]
])
->call('save')
->assertHasNoFormErrors();
livewire(OrderResource\Pages\EditOrder::class,[
'record' => $order->id
])
->assertSee('Rij toevoegen')
->callFormComponentAction('items','add')
->fillForm([
'items' => [
[
'product_id' => $product->id,
'quantity' => 5,
'type' => OrderGoal::Stock,
'reference' => 12345
]
]
])
->call('save')
->assertHasNoFormErrors();
8 replies
FFilament
Created by Tom on 1/22/2025 in #❓┊help
#fileupload #test #pest
So with a little assistance from Copilot, I was able to get it working using the ->set() method.
livewire(EditRecipe::class, ['record' => $recipe->getRouteKey()])
->fillForm([
'title' => $recipe->title,
'description' => $recipe->description,
// 'image' => [$newFile],
])
->set('data.image', [$newFile])
->call('save')
->assertHasNoFormErrors();
livewire(EditRecipe::class, ['record' => $recipe->getRouteKey()])
->fillForm([
'title' => $recipe->title,
'description' => $recipe->description,
// 'image' => [$newFile],
])
->set('data.image', [$newFile])
->call('save')
->assertHasNoFormErrors();
7 replies
FFilament
Created by Diana on 10/16/2023 in #❓┊help
assertTableActionDataSet() on a form with FileUpload field
So with a little assistance from Copilot, I was able to get it working using the ->set() method.
livewire(EditRecipe::class, ['record' => $recipe->getRouteKey()])
->fillForm([
'title' => $recipe->title,
'description' => $recipe->description,
// 'image' => [$newFile],
])
->set('data.image', [$newFile])
->call('save')
->assertHasNoFormErrors();
livewire(EditRecipe::class, ['record' => $recipe->getRouteKey()])
->fillForm([
'title' => $recipe->title,
'description' => $recipe->description,
// 'image' => [$newFile],
])
->set('data.image', [$newFile])
->call('save')
->assertHasNoFormErrors();
6 replies
FFilament
Created by Tom on 1/22/2025 in #❓┊help
#fileupload #test #pest
I didn't think to use dot notation on the image field. Unfortunately, this only works me if the resources doesn't have an existing image attached to it. Does your test still work if you assign an initial image to the $blog? Mine retains the original image path and won't save the path to the new one. (Although the file itself is being created).
7 replies
FFilament
Created by Diana on 10/16/2023 in #❓┊help
assertTableActionDataSet() on a form with FileUpload field
Did you ever figure this one out? I'm having a similar issue.
6 replies
FFilament
Created by Erik on 8/14/2023 in #❓┊help
Modify a repeater's element with $set at an EditResource page
Just starting to play around with repeaters myself. Have you tried $set('repeaterId.item0.field', 'value'); $set('repeaterId.item1.field', 'another value');?
3 replies