get(route('home')) ->assertOk() ->assertSee('Libra'); }); test('booking page is accessible', function () { $this->get(route('booking')) ->assertOk(); }); test('posts page is accessible', function () { $this->get(route('posts.index')) ->assertOk(); }); test('terms page is accessible', function () { $this->get(route('terms')) ->assertOk(); }); test('privacy page is accessible', function () { $this->get(route('privacy')) ->assertOk(); }); }); describe('Navigation Component', function () { test('navigation displays on public pages', function () { $this->get(route('home')) ->assertOk() ->assertSee('data-test="main-navigation"', false); }); test('navigation shows home link', function () { $this->get(route('home')) ->assertOk() ->assertSee('data-test="nav-home"', false); }); test('navigation shows booking link', function () { $this->get(route('home')) ->assertOk() ->assertSee('data-test="nav-booking"', false); }); test('navigation shows posts link', function () { $this->get(route('home')) ->assertOk() ->assertSee('data-test="nav-posts"', false); }); test('navigation shows login link for guests', function () { $this->get(route('home')) ->assertOk() ->assertSee('data-test="nav-login"', false); }); test('navigation shows dashboard link for authenticated users', function () { $user = User::factory()->create(); $this->actingAs($user) ->get(route('home')) ->assertOk() ->assertSee('data-test="nav-dashboard"', false); }); test('navigation shows logout for authenticated users', function () { $user = User::factory()->create(); $this->actingAs($user) ->get(route('home')) ->assertOk() ->assertSee('data-test="nav-logout"', false); }); test('navigation hides login for authenticated users', function () { $user = User::factory()->create(); $this->actingAs($user) ->get(route('home')) ->assertOk() ->assertDontSee('data-test="nav-login"', false); }); }); describe('Mobile Menu', function () { test('mobile menu button is present', function () { $this->get(route('home')) ->assertOk() ->assertSee('data-test="mobile-menu-button"', false); }); test('mobile menu container is present', function () { $this->get(route('home')) ->assertOk() ->assertSee('data-test="mobile-menu"', false); }); }); describe('Footer Component', function () { test('footer displays on public pages', function () { $this->get(route('home')) ->assertOk() ->assertSee('data-test="main-footer"', false); }); test('footer contains terms link', function () { $this->get(route('home')) ->assertOk() ->assertSee('data-test="footer-terms"', false); }); test('footer contains privacy link', function () { $this->get(route('home')) ->assertOk() ->assertSee('data-test="footer-privacy"', false); }); test('footer displays current year in copyright', function () { $currentYear = date('Y'); $this->get(route('home')) ->assertOk() ->assertSee($currentYear); }); }); describe('Language Toggle in Navigation', function () { test('language toggle is visible', function () { $this->get(route('home')) ->assertOk() ->assertSee('data-test="language-switch-ar"', false) ->assertSee('data-test="language-switch-en"', false); }); test('switching to Arabic applies RTL layout', function () { $this->get(route('language.switch', 'ar')) ->assertRedirect(); $this->get(route('home')) ->assertOk() ->assertSee('dir="rtl"', false); }); test('switching to English applies LTR layout', function () { $this->get(route('language.switch', 'en')) ->assertRedirect(); $this->get(route('home')) ->assertOk() ->assertSee('dir="ltr"', false); }); }); describe('Navigation Translations', function () { test('English navigation translations are loaded', function () { expect(__('navigation.home', [], 'en'))->toBe('Home'); expect(__('navigation.booking', [], 'en'))->toBe('Book Consultation'); expect(__('navigation.posts', [], 'en'))->toBe('Legal Insights'); expect(__('navigation.login', [], 'en'))->toBe('Login'); expect(__('navigation.logout', [], 'en'))->toBe('Log Out'); expect(__('navigation.dashboard', [], 'en'))->toBe('Dashboard'); }); test('Arabic navigation translations are loaded', function () { expect(__('navigation.home', [], 'ar'))->toBe('الرئيسية'); expect(__('navigation.booking', [], 'ar'))->toBe('حجز استشارة'); expect(__('navigation.posts', [], 'ar'))->toBe('مقالات قانونية'); expect(__('navigation.login', [], 'ar'))->toBe('تسجيل الدخول'); expect(__('navigation.logout', [], 'ar'))->toBe('تسجيل الخروج'); expect(__('navigation.dashboard', [], 'ar'))->toBe('لوحة التحكم'); }); }); describe('Footer Translations', function () { test('English footer translations are loaded', function () { expect(__('footer.terms', [], 'en'))->toBe('Terms of Service'); expect(__('footer.privacy', [], 'en'))->toBe('Privacy Policy'); expect(__('footer.copyright', [], 'en'))->toBe('Libra Law Firm. All rights reserved.'); }); test('Arabic footer translations are loaded', function () { expect(__('footer.terms', [], 'ar'))->toBe('شروط الخدمة'); expect(__('footer.privacy', [], 'ar'))->toBe('سياسة الخصوصية'); expect(__('footer.copyright', [], 'ar'))->toBe('مكتب الميزان للمحاماة. جميع الحقوق محفوظة.'); }); }); describe('Tailwind Colors', function () { test('app.css contains brand colors', function () { $css = file_get_contents(resource_path('css/app.css')); expect($css)->toContain('--color-navy: #0A1F44'); expect($css)->toContain('--color-gold: #D4AF37'); expect($css)->toContain('--color-gold-light: #F4E4B8'); expect($css)->toContain('--color-cream: #F9F7F4'); expect($css)->toContain('--color-charcoal: #2C3E50'); }); }); describe('Accessibility Features', function () { test('skip to content link is present', function () { $this->get(route('home')) ->assertOk() ->assertSee('data-test="skip-to-content"', false) ->assertSee('href="#main-content"', false); }); test('main content has proper id for skip link', function () { $this->get(route('home')) ->assertOk() ->assertSee('id="main-content"', false); }); test('mobile menu has proper ARIA attributes', function () { $this->get(route('home')) ->assertOk() ->assertSee('role="dialog"', false) ->assertSee('aria-modal="true"', false); }); test('mobile menu button has aria-expanded attribute', function () { $this->get(route('home')) ->assertOk() ->assertSee(':aria-expanded="mobileMenuOpen"', false); }); });