© 2026 Hedgehog Software, LLC
Failed asserting that null matches expected '200g'.
it('can fill in the edit page with retrieved data', function (){ // Arrange $recipe = Recipe::factory() ->has(RecipeIngredient::factory(2), 'ingredients') ->create(); // Act & Assert livewire(RecipeResource\Pages\EditRecipe::class, [ 'record' => $recipe->getRouteKey(), ]) ->assertFormSet([ 'title' => [ 'nl' => $recipe->title, 'en' => $recipe->title, 'fr' => $recipe->title, ], 'recipe_ingredients' => $recipe->ingredients()->get()->map(function ($ingredient) { return [ 'quantity' => $ingredient->quantity, 'ingredient_id' => $ingredient->ingredient_id, ]; })->toArray() ]); });
Section::make('Ingrediënten') ->schema([ Repeater::make('recipe_ingredients') ->label('') ->relationship('ingredients') ->schema([ TextInput::make('quantity') ->label('Hoeveelheid') ->required(), Select::make('ingredient_id') ->relationship('ingredient', 'name') ->preload() ->searchable() ->label('Naam') ->required(), ])->columns(2), ]),