feat: fix test
This commit is contained in:
parent
c9b51f3225
commit
3bc079e568
|
|
@ -24,7 +24,7 @@ class MealPostsRequest extends FormRequest
|
||||||
'title' => [$isCreating ? 'required' : 'sometimes', 'string', 'max:255'],
|
'title' => [$isCreating ? 'required' : 'sometimes', 'string', 'max:255'],
|
||||||
'eaten_at' => [$isCreating ? 'required' : 'sometimes', 'date'],
|
'eaten_at' => [$isCreating ? 'required' : 'sometimes', 'date'],
|
||||||
'type' => [$isCreating ? 'required' : 'sometimes', Rule::enum(MealPostType::class)],
|
'type' => [$isCreating ? 'required' : 'sometimes', Rule::enum(MealPostType::class)],
|
||||||
'visibility' => [$isCreating ? 'required' :'sometimes', Rule::enum(MealPostVisibility::class)],
|
'visibility' => ['sometimes', Rule::enum(MealPostVisibility::class)],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,7 @@ it('stores and returns the selected meal post visibility', function () {
|
||||||
'title' => 'Bowl saumon avocat',
|
'title' => 'Bowl saumon avocat',
|
||||||
'eaten_at' => '2026-05-16T12:00:00.000Z',
|
'eaten_at' => '2026-05-16T12:00:00.000Z',
|
||||||
'visibility' => MealPostVisibility::Followers->value,
|
'visibility' => MealPostVisibility::Followers->value,
|
||||||
|
'type' => \App\Enums\MealPostType::BREAKFAST->value,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$response
|
$response
|
||||||
|
|
@ -40,6 +41,7 @@ it('defaults meal post visibility to private', function () {
|
||||||
'image_url' => 'https://example.com/meal.jpg',
|
'image_url' => 'https://example.com/meal.jpg',
|
||||||
'title' => 'Bowl saumon avocat',
|
'title' => 'Bowl saumon avocat',
|
||||||
'eaten_at' => '2026-05-16T12:00:00.000Z',
|
'eaten_at' => '2026-05-16T12:00:00.000Z',
|
||||||
|
'type' => \App\Enums\MealPostType::BREAKFAST->value,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$response
|
$response
|
||||||
|
|
@ -55,6 +57,7 @@ it('validates meal post visibility', function () {
|
||||||
'title' => 'Bowl saumon avocat',
|
'title' => 'Bowl saumon avocat',
|
||||||
'eaten_at' => '2026-05-16T12:00:00.000Z',
|
'eaten_at' => '2026-05-16T12:00:00.000Z',
|
||||||
'visibility' => 'friends',
|
'visibility' => 'friends',
|
||||||
|
'type' => \App\Enums\MealPostType::BREAKFAST->value,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$response
|
$response
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue