filament/filament
3.2.123
11.31.0
3.5.12
8.3.13
I've got a CreateRecord page of my model
I define the form in the corresponding page with a wizard with multiple steps (4 in my case)
public function form(Form $form): Form
{
$form->columns(3);
$form->schema([
Wizard::make([
Wizard\Step::make(__('filament.projects.label-singular'))
->schema(self::getProjectStep()),
Wizard\Step::make(__('details'))
->schema(self::getDetailsStep()),
Wizard\Step::make(__('filament.tasks.photo'))
->schema(self::getPhotoStep()),
Wizard\Step::make(__('filament.tasks.floorplan'))
->schema(self::getFloorPlanStep()),
])
->startOnStep(function (): int {
if ($this->projectId > 0) {
return 2;
}
return 1;
})
->submitAction($this->getSubmitFormAction())
]);
return parent::form($form);
}
Then in my tests i would expect the "assertWizardCurrentStep" to be 2, but, it's 1.
Livewire::withQueryParams([
'projectId' => $project->id
])->test(CreateTask::class)
->assertWizardCurrentStep(2); // fails!
```
I've also tested this by not providing a closure and a hard coded 2, which results in the same false assertion
### Expected behavior
I'm expecting the assertWizardStartingStep to assert to 2 in stead of 1.
I've tried
### Steps to reproduce
1. Create a CreatePage of any model.
2. Define a wizard in the form with multiple steps.
3. Set starting step on 2 (or greater then 1)
4. Create a test and assert using assertWizardCurrentStep that the current step is 2.
5. Check the view in the browser: it is not.
### Reproduction repository (issue will be closed if this is not valid)
https://github.com/herrwalter/filament-issue-current-step
### Relevant log output
_No response_
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too