seed(); $demoUser = User::query()->where('email', 'test@example.com')->firstOrFail(); $onboardingUser = User::query()->where('email', 'onboarding@example.com')->firstOrFail(); expect(User::query()->count())->toBe(10) ->and($demoUser->hasCompletedNutritionOnboarding())->toBeTrue() ->and($onboardingUser->hasCompletedNutritionOnboarding())->toBeFalse() ->and(User::query()->whereNotNull('onboarding_completed_at')->count())->toBe(9) ->and($demoUser->nutritionPlans()->count())->toBe(1) ->and($onboardingUser->nutritionPlans()->count())->toBe(0) ->and($demoUser->weightEntries()->count())->toBe(12) ->and($demoUser->workouts()->count())->toBe(12) ->and($demoUser->following()->count())->toBe(8) ->and(MealPosts::query()->where('visibility', MealPostVisibility::Public)->count())->toBe(48) ->and(MealPostIngredients::query()->count())->toBe(144) ->and(PostReviews::query()->count())->toBe(120) ->and( MealPosts::query() ->withCount('likedByUsers') ->get() ->sum('liked_by_users_count') )->toBeGreaterThan(100); }); it('fills more than one explorer page with usable meal images', function () { $this->seed(DemoContentSeeder::class); $demoUser = User::query()->where('email', 'test@example.com')->firstOrFail(); Sanctum::actingAs($demoUser); $this->getJson('/api/meal-posts?per_page=30&page=1') ->assertOk() ->assertJsonCount(30, 'data') ->assertJsonPath('meta.current_page', 1) ->assertJsonPath('meta.last_page', 2) ->assertJsonPath('meta.total', 48) ->assertJsonPath('data.0.imageUrl', fn (string $url): bool => str_starts_with($url, 'https://images.unsplash.com/')); $this->getJson('/api/meal-posts?per_page=30&page=2') ->assertOk() ->assertJsonCount(18, 'data') ->assertJsonPath('meta.current_page', 2); });