How do you test repeaters?
Livewire::test(CreateFlexListing::class)
->fillForm([
'occupationId' => Occupation::factory()->create()->id,
'description' => 'Looking for help with our Laravel app!',
'shifts' => [
[
'date' => '2023-02-16',
'to' => '17:00',
'from' => '09:00',
],
]
])
->call('save')
->assertHasNoFormErrors();Livewire::test(CreateFlexListing::class)
->fillForm([
'occupationId' => Occupation::factory()->create()->id,
'description' => 'Looking for help with our Laravel app!',
'shifts' => [
[
'date' => '2023-02-16',
'to' => '17:00',
'from' => '09:00',
],
]
])
->call('save')
->assertHasNoFormErrors();I have a test like this but it doesn't seem to work:
Component has errors: "data.shifts.5c4b1833-1895-4afb-9689-c763674b6672.date", "data.shifts.5c4b1833-1895-4afb-9689-c763674b6672.startsAt", "data.shifts.5c4b1833-1895-4afb-9689-c763674b6672.endsAt"Component has errors: "data.shifts.5c4b1833-1895-4afb-9689-c763674b6672.date", "data.shifts.5c4b1833-1895-4afb-9689-c763674b6672.startsAt", "data.shifts.5c4b1833-1895-4afb-9689-c763674b6672.endsAt"