withSession(['locale' => $locale])->get('/')->assertOk()->getContent(); } test('home renders the seven sections in order in both languages', function () { foreach (['ar', 'en'] as $locale) { $html = homeHtml($locale); $positions = array_map(fn ($id) => strpos($html, 'id="'.$id.'"'), ['top', 'founder', 'services', 'mission', 'values', 'posts']); $bandPos = strpos($html, 'class="band on-dark"'); foreach ($positions as $p) { expect($p)->not->toBeFalse(); } $sorted = $positions; sort($sorted); expect($positions)->toBe($sorted); expect($bandPos)->toBeGreaterThan($positions[0])->toBeLessThan($positions[1]); } }); test('home copy comes from the site and home keys', function () { $ar = homeHtml('ar'); expect($ar)->toContain(__('site.hero_title_em', [], 'ar'))->toContain(__('site.vision_title', [], 'ar')) ->toContain(__('home.services_subtitle', [], 'ar')); $en = homeHtml('en'); expect($en)->toContain('daily practice')->toContain('Woven from the fabric of society')->toContain('Article 04'); }); test('home has one h1 and every image has alt text', function () { foreach (['ar', 'en'] as $locale) { $html = homeHtml($locale); expect(substr_count($html, '