tests: retire or rewrite old About/Home/Responsive/Navigation assertions superseded by the redesign

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Naser Mansour
2026-10-31 19:10:12 +02:00
parent 9263966266
commit f1ca648672
5 changed files with 23 additions and 471 deletions
+4 -11
View File
@@ -170,13 +170,6 @@ describe('Footer Component', function () {
});
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();
@@ -220,16 +213,16 @@ 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.');
expect(__('footer.address', [], 'en'))->toBe('American Building - Next to Al-Shini - 4th Floor');
expect(__('footer.copyright', [], 'en'))->toBe('Libra for Rights. All rights reserved.');
expect(__('footer.address', [], 'en'))->toBe('Jaffa Street - Next to Al-Shini - American Building - 4th Floor');
expect(__('footer.phone', [], 'en'))->toBe('+970 599 353 502');
});
test('Arabic footer translations are loaded', function () {
expect(__('footer.terms', [], 'ar'))->toBe('شروط الخدمة');
expect(__('footer.privacy', [], 'ar'))->toBe('سياسة الخصوصية');
expect(__('footer.copyright', [], 'ar'))->toBe('مكتب ليبرا للمحاماة. جميع الحقوق محفوظة.');
expect(__('footer.address', [], 'ar'))->toBe('العمارة الأمريكية - بجانب الشني - الطابق الرابع');
expect(__('footer.copyright', [], 'ar'))->toBe('مكتب ليبرا للحقوق. جميع الحقوق محفوظة.');
expect(__('footer.address', [], 'ar'))->toBe('شارع يافا - بجانب الشني - العمارة الأمريكية - الطابق الرابع');
expect(__('footer.phone', [], 'ar'))->toBe('+970 599 353 502');
});
});
+2 -305
View File
@@ -19,18 +19,12 @@ test('about page uses public layout', function () {
});
// AC3: Hero Section Container
test('about page hero section has dark forest green background', function () {
$this->get('/about')
->assertOk()
->assertSee('bg-[#2D3624]', false);
});
// AC4: Page Title
test('about page displays title in English', function () {
$this->withSession(['locale' => 'en'])
->get('/about')
->assertOk()
->assertSee('About Us');
->assertSee(__('site.nav_about', [], 'en'));
});
test('about page displays title in Arabic', function () {
@@ -56,20 +50,6 @@ test('about page displays tagline in Arabic', function () {
});
// AC6: Identity Statement
test('about page displays identity statement in English', function () {
$this->withSession(['locale' => 'en'])
->get('/about')
->assertOk()
->assertSee('A legal institution woven from the fabric of society, using research as a tool of power to serve justice.');
});
test('about page displays identity statement in Arabic', function () {
$this->withSession(['locale' => 'ar'])
->get('/about')
->assertOk()
->assertSee('مؤسسة قانونية منسوجة من نسيج المجتمع، تستخدم البحث كأداة قوة لخدمة العدالة.');
});
// AC8: RTL Support - Verified via locale setting (RTL is handled by layout)
test('about page sets correct language direction for Arabic', function () {
$this->withSession(['locale' => 'ar'])
@@ -90,7 +70,7 @@ test('navigation contains about us link in English', function () {
$this->withSession(['locale' => 'en'])
->get('/')
->assertOk()
->assertSee('About Us')
->assertSee(__('site.nav_about', [], 'en'))
->assertSee('href="'.route('about').'"', false);
});
@@ -117,12 +97,6 @@ test('mobile navigation contains about us link', function () {
// Story 16.2: Vision & Mission Section Tests
// AC1: Vision Section Container
test('about page has vision section with white background', function () {
$this->get('/about')
->assertOk()
->assertSee('bg-white py-8', false);
});
// AC2: Vision Section Header
test('about page displays vision title in English', function () {
$this->withSession(['locale' => 'en'])
@@ -139,27 +113,7 @@ test('about page displays vision title in Arabic', function () {
});
// AC3: Vision Statement
test('about page displays vision statement in English', function () {
$this->withSession(['locale' => 'en'])
->get('/about')
->assertOk()
->assertSee('Libra is woven from the fabric of society');
});
test('about page displays vision statement in Arabic', function () {
$this->withSession(['locale' => 'ar'])
->get('/about')
->assertOk()
->assertSee('ليبرا منسوجة من نسيج المجتمع');
});
// AC4: Mission Section Container
test('about page has mission section with cream background', function () {
$this->get('/about')
->assertOk()
->assertSee('bg-background py-8', false);
});
// AC5: Mission Section Header
test('about page displays mission title in English', function () {
$this->withSession(['locale' => 'en'])
@@ -168,13 +122,6 @@ test('about page displays mission title in English', function () {
->assertSee('Our Mission');
});
test('about page displays mission title in Arabic', function () {
$this->withSession(['locale' => 'ar'])
->get('/about')
->assertOk()
->assertSee('مهمتنا');
});
// AC6: Mission Cards - Institution
test('about page displays institution mission card in English', function () {
$this->withSession(['locale' => 'en'])
@@ -193,22 +140,6 @@ test('about page displays institution mission card in Arabic', function () {
});
// AC6: Mission Cards - Society
test('about page displays society mission card in English', function () {
$this->withSession(['locale' => 'en'])
->get('/about')
->assertOk()
->assertSee('For Society')
->assertSee('Libra Scholarship for Law and Palestinian Arts');
});
test('about page displays society mission card in Arabic', function () {
$this->withSession(['locale' => 'ar'])
->get('/about')
->assertOk()
->assertSee('للمجتمع')
->assertSee('منحة ليبرا للقانون والفنون الفلسطينية');
});
// AC6: Mission Cards - Diaspora
test('about page displays diaspora mission card in English', function () {
$this->withSession(['locale' => 'en'])
@@ -227,19 +158,7 @@ test('about page displays diaspora mission card in Arabic', function () {
});
// AC7: Mission Card Styling
test('about page mission cards have correct styling', function () {
$this->get('/about')
->assertOk()
->assertSee('bg-white rounded-lg shadow-sm p-6', false);
});
// AC8: Responsive Grid
test('about page mission cards use responsive grid', function () {
$this->get('/about')
->assertOk()
->assertSee('grid-cols-1 md:grid-cols-2 lg:grid-cols-3', false);
});
// AC7: Icons present (Flux renders icons as inline SVGs)
test('about page mission cards have icons', function () {
$this->get('/about')
@@ -250,12 +169,6 @@ test('about page mission cards have icons', function () {
// Story 16.3: Values Section Tests
// AC1: Values Section Container
test('about page has values section with white background', function () {
$this->get('/about')
->assertOk()
->assertSee('bg-white py-8 sm:py-12 lg:py-[60px]', false);
});
// AC2: Values Section Header
test('about page displays values title in English', function () {
$this->withSession(['locale' => 'en'])
@@ -373,28 +286,10 @@ test('about page displays social innovation value in Arabic', function () {
});
// AC5: Value Card Styling
test('about page value cards have correct styling', function () {
$this->get('/about')
->assertOk()
->assertSee('bg-background rounded-xl p-6 text-center hover:shadow-md transition-shadow', false);
});
// AC6: Responsive Grid
test('about page value cards use responsive grid', function () {
$this->get('/about')
->assertOk()
->assertSee('grid-cols-2 md:grid-cols-3 lg:grid-cols-6', false);
});
// Story 16.4: Goals Section Tests
// AC1: Goals Section Container
test('about page has goals section with cream background', function () {
$this->get('/about')
->assertOk()
->assertSee('bg-background py-8 sm:py-12 lg:py-[60px]', false);
});
// AC2: Goals Section Header
test('about page displays goals title in English', function () {
$this->withSession(['locale' => 'en'])
@@ -511,26 +406,8 @@ test('about page displays goal 7 in Arabic', function () {
});
// AC4: Goals Card Container Styling
test('about page goals section has white card container', function () {
$this->get('/about')
->assertOk()
->assertSee('bg-white rounded-lg shadow-sm p-6 sm:p-8 max-w-5xl mx-auto', false);
});
// AC5: Numbered Circle Style
test('about page goals have numbered circles with gold background', function () {
$this->get('/about')
->assertOk()
->assertSee('w-8 h-8 bg-accent text-white rounded-full', false);
});
// AC6: Responsive Grid Layout
test('about page goals use responsive grid layout', function () {
$this->get('/about')
->assertOk()
->assertSee('grid-cols-1 md:grid-cols-2 gap-x-12 gap-y-6', false);
});
// AC7: All 7 goal numbers are displayed
test('about page displays all 7 goal numbers', function () {
$response = $this->withSession(['locale' => 'en'])->get('/about');
@@ -543,12 +420,6 @@ test('about page displays all 7 goal numbers', function () {
// Story 16.5: Legal Services Section Tests
// AC1: Services Section Container
test('about page has services section with white background', function () {
$this->get('/about')
->assertOk()
->assertSee('bg-white py-8 sm:py-12 lg:py-[60px]', false);
});
// AC2: Services Section Header
test('about page displays services title in English', function () {
$this->withSession(['locale' => 'en'])
@@ -565,20 +436,6 @@ test('about page displays services title in Arabic', function () {
});
// AC3: Services Introduction
test('about page displays services intro in English', function () {
$this->withSession(['locale' => 'en'])
->get('/about')
->assertOk()
->assertSee('Libra provides comprehensive legal services as a for-profit law firm, combining traditional legal practice with research-driven insight.');
});
test('about page displays services intro in Arabic', function () {
$this->withSession(['locale' => 'ar'])
->get('/about')
->assertOk()
->assertSee('تقدم ليبرا خدمات قانونية شاملة كمكتب محاماة ربحي، يجمع بين الممارسة القانونية التقليدية والرؤية المبنية على البحث.');
});
// AC4: Four Service Categories - Card 1: Legal Consultations & Representation
test('about page displays consultation service card title in English', function () {
$this->withSession(['locale' => 'en'])
@@ -703,42 +560,8 @@ test('about page displays business service card title in Arabic', function () {
->assertSee('الخدمات القانونية للأعمال');
});
test('about page displays business service items in English', function () {
$this->withSession(['locale' => 'en'])
->get('/about')
->assertOk()
->assertSee('Contract drafting')
->assertSee('review')
->assertSee('Governance')
->assertSee('compliance')
->assertSee('Arbitration')
->assertSee('Alternative dispute resolution');
});
test('about page displays business service items in Arabic', function () {
$this->withSession(['locale' => 'ar'])
->get('/about')
->assertOk()
->assertSee('صياغة ومراجعة العقود')
->assertSee('الحوكمة والامتثال')
->assertSee('التحكيم')
->assertSee('الحل البديل للنزاعات');
});
// AC5: Service Card Styling
test('about page service cards have correct styling', function () {
$this->get('/about')
->assertOk()
->assertSee('bg-background rounded-xl p-8 text-center shadow-sm', false);
});
// AC6: Responsive Grid
test('about page service cards use responsive grid', function () {
$this->get('/about')
->assertOk()
->assertSee('grid-cols-1 md:grid-cols-2 lg:grid-cols-4', false);
});
// AC7: CTA Button
test('about page services section has CTA button in English', function () {
$this->withSession(['locale' => 'en'])
@@ -763,136 +586,10 @@ test('about page services CTA links to booking page', function () {
// Story 16.6: Scholarship Aspiration Section Tests
// AC1: Scholarship Section Container
test('about page has scholarship section with dark forest green background', function () {
$this->get('/about')
->assertOk()
->assertSee('bg-[#2D3624] py-8 sm:py-12 lg:py-[60px]', false);
});
// AC2: Scholarship Section Header
test('about page displays scholarship title in English', function () {
$this->withSession(['locale' => 'en'])
->get('/about')
->assertOk()
->assertSee('Our Aspiration: Libra Scholarship');
});
test('about page displays scholarship title in Arabic', function () {
$this->withSession(['locale' => 'ar'])
->get('/about')
->assertOk()
->assertSee('طموحنا: منحة ليبرا');
});
// AC3: Scholarship Description
test('about page displays scholarship description paragraph 1 in English', function () {
$this->withSession(['locale' => 'en'])
->get('/about')
->assertOk()
->assertSee('Art is the ambassador of Historical Palestine and the Palestinian people.');
});
test('about page displays scholarship description paragraph 1 in Arabic', function () {
$this->withSession(['locale' => 'ar'])
->get('/about')
->assertOk()
->assertSee('الفن هو سفير فلسطين التاريخية والشعب الفلسطيني.');
});
test('about page displays scholarship description paragraph 2 in English', function () {
$this->withSession(['locale' => 'en'])
->get('/about')
->assertOk()
->assertSee('We aim to open ongoing discussions about the Palestinian situation and reality');
});
test('about page displays scholarship description paragraph 2 in Arabic', function () {
$this->withSession(['locale' => 'ar'])
->get('/about')
->assertOk()
->assertSee('نهدف إلى فتح نقاشات مستمرة حول الوضع والواقع الفلسطيني');
});
// AC4: Key Aspirations List
test('about page displays aspiration 1 in English', function () {
$this->withSession(['locale' => 'en'])
->get('/about')
->assertOk()
->assertSee('Empowering students to present Palestinian messages globally');
});
test('about page displays aspiration 1 in Arabic', function () {
$this->withSession(['locale' => 'ar'])
->get('/about')
->assertOk()
->assertSee('تمكين الطلاب من تقديم الرسائل الفلسطينية عالمياً');
});
test('about page displays aspiration 2 in English', function () {
$this->withSession(['locale' => 'en'])
->get('/about')
->assertOk()
->assertSee('Opening ongoing discussions about Palestinian reality');
});
test('about page displays aspiration 2 in Arabic', function () {
$this->withSession(['locale' => 'ar'])
->get('/about')
->assertOk()
->assertSee('فتح نقاشات مستمرة حول الواقع الفلسطيني');
});
test('about page displays aspiration 3 in English', function () {
$this->withSession(['locale' => 'en'])
->get('/about')
->assertOk()
->assertSee('Protecting intellectual property rights');
});
test('about page displays aspiration 3 in Arabic', function () {
$this->withSession(['locale' => 'ar'])
->get('/about')
->assertOk()
->assertSee('حماية حقوق الملكية الفكرية');
});
test('about page displays aspiration 4 in English', function () {
$this->withSession(['locale' => 'en'])
->get('/about')
->assertOk()
->assertSee('Enabling participation in local and international exhibitions');
});
test('about page displays aspiration 4 in Arabic', function () {
$this->withSession(['locale' => 'ar'])
->get('/about')
->assertOk()
->assertSee('تمكين المشاركة في المعارض المحلية والدولية');
});
// AC5: Aspiration Item Styling (icons in scholarship section)
test('about page scholarship aspirations have icons', function () {
$this->get('/about')
->assertOk()
->assertSee('w-6 h-6 text-accent flex-shrink-0', false);
});
// AC6: Visual Accent (decorative border)
test('about page scholarship section has decorative accent', function () {
$this->get('/about')
->assertOk()
->assertSee('border-accent/20', false);
});
// AC7: Responsive Layout
test('about page scholarship aspirations use responsive grid', function () {
$this->get('/about')
->assertOk()
->assertSee('grid-cols-1 sm:grid-cols-2 lg:grid-cols-4', false);
});
// AC8: All 4 aspirations are present
test('about page displays all 4 scholarship aspirations', function () {
$this->withSession(['locale' => 'en'])->get('/about')->assertOk();
expect(count(__('about.scholarship_aspirations')))->toBe(4);
});
+1 -1
View File
@@ -33,7 +33,7 @@ test('logged in user sees message to book from dashboard', function () {
test('guest booking page shows calendar', function () {
$this->get(route('booking'))
->assertOk()
->assertSee(__('booking.guest_intro'));
->assertSee('calendar-grid', false);
});
test('guest can select a slot and see contact form', function () {
+15 -93
View File
@@ -83,12 +83,6 @@ test('home page contains services section with id', function () {
// About Section Tests
test('home page contains about section with id', function () {
$this->get('/')
->assertOk()
->assertSee('id="about"', false);
});
test('home page displays about section title in English', function () {
$this->withSession(['locale' => 'en'])
->get('/')
@@ -188,70 +182,6 @@ test('home page displays services section subtitle in Arabic', function () {
->assertSee('حلول قانونية شاملة للأفراد والشركات');
});
test('home page displays legal consultations service in English', function () {
$this->withSession(['locale' => 'en'])
->get('/')
->assertOk()
->assertSee('Legal Consultations')
->assertSee('Expert legal advice tailored to your specific situation and needs.');
});
test('home page displays legal consultations service in Arabic', function () {
$this->withSession(['locale' => 'ar'])
->get('/')
->assertOk()
->assertSee('الاستشارات القانونية')
->assertSee('استشارات قانونية متخصصة مصممة وفقاً لوضعك واحتياجاتك.');
});
test('home page displays court representation service in English', function () {
$this->withSession(['locale' => 'en'])
->get('/')
->assertOk()
->assertSee('Court Representation')
->assertSee('Professional representation before courts and judicial bodies at all stages.');
});
test('home page displays court representation service in Arabic', function () {
$this->withSession(['locale' => 'ar'])
->get('/')
->assertOk()
->assertSee('التمثيل أمام المحاكم')
->assertSee('تمثيل احترافي أمام المحاكم والهيئات القضائية في جميع المراحل.');
});
test('home page displays litigation management service in English', function () {
$this->withSession(['locale' => 'en'])
->get('/')
->assertOk()
->assertSee('Litigation Management')
->assertSee('Complete case management from pleadings and memoranda to appeals.');
});
test('home page displays litigation management service in Arabic', function () {
$this->withSession(['locale' => 'ar'])
->get('/')
->assertOk()
->assertSee('إدارة الدعاوى')
->assertSee('إدارة كاملة للقضايا من اللوائح والمذكرات إلى الاستئنافات.');
});
test('home page displays contract services in English', function () {
$this->withSession(['locale' => 'en'])
->get('/')
->assertOk()
->assertSee('Contract Services')
->assertSee('Drafting, review, and legal compliance for all your contractual needs.');
});
test('home page displays contract services in Arabic', function () {
$this->withSession(['locale' => 'ar'])
->get('/')
->assertOk()
->assertSee('خدمات العقود')
->assertSee('صياغة ومراجعة العقود والامتثال القانوني لجميع احتياجاتكم التعاقدية.');
});
// Values Section Tests
test('home page contains values section with id', function () {
@@ -374,13 +304,6 @@ test('home page displays social innovation value in Arabic', function () {
// Latest Posts Section Tests
test('home page does not display posts section when no published posts exist', function () {
// No posts created
$this->get('/')
->assertOk()
->assertDontSee('id="posts"', false);
});
test('home page displays posts section when published posts exist', function () {
Post::factory()->published()->count(3)->create();
@@ -407,22 +330,6 @@ test('home page displays posts section title in Arabic', function () {
->assertSee('أحدث المقالات');
});
test('home page displays maximum 3 latest posts', function () {
// Create 5 published posts
Post::factory()->published()->count(5)->create();
$response = $this->get('/');
$response->assertOk();
// The section should exist
$response->assertSee('id="posts"', false);
// Count the number of post cards (articles with specific class)
$content = $response->getContent();
$postCardCount = substr_count($content, 'class="bg-card p-6 rounded-lg shadow-card hover:shadow-card-hover transition-shadow"');
expect($postCardCount)->toBe(3);
});
test('home page displays post titles', function () {
$post = Post::factory()->published()->create([
'title' => ['en' => 'Test English Title', 'ar' => 'عنوان اختبار'],
@@ -565,3 +472,18 @@ test('home page displays footer address with street name in Arabic', function ()
->assertOk()
->assertSee('شارع يافا - بجانب الشني - العمارة الأمريكية - الطابق الرابع');
});
test('home page shows the empty articles message when no posts are published', function () {
$this->withSession(['locale' => 'en'])
->get('/')
->assertOk()
->assertSee(__('home.posts_empty', [], 'en'));
});
test('home page displays maximum 3 latest posts', function () {
Post::factory()->published()->count(5)->create();
$html = $this->get('/')->assertOk()->getContent();
expect(substr_count($html, 'class="post"'))->toBe(3);
});
-60
View File
@@ -172,72 +172,12 @@ describe('Forms Responsive', function () {
});
describe('Footer Responsive', function () {
test('footer has responsive grid', function () {
$viewPath = resource_path('views/components/footer.blade.php');
$viewContent = file_get_contents($viewPath);
expect($viewContent)->toContain('grid-cols-1 sm:grid-cols-2 lg:grid-cols-3');
});
test('footer has responsive padding', function () {
$viewPath = resource_path('views/components/footer.blade.php');
$viewContent = file_get_contents($viewPath);
expect($viewContent)->toContain('px-4 sm:px-6 lg:px-8');
});
test('footer links are touch-friendly', function () {
$viewPath = resource_path('views/components/footer.blade.php');
$viewContent = file_get_contents($viewPath);
expect($viewContent)->toContain('min-h-[44px]');
});
});
describe('Public Pages Responsive', function () {
test('home page has responsive grid', function () {
$viewPath = resource_path('views/pages/home.blade.php');
$viewContent = file_get_contents($viewPath);
expect($viewContent)->toContain('grid-cols-1 sm:grid-cols-2 lg:grid-cols-3');
});
test('home page has responsive text sizing', function () {
$viewPath = resource_path('views/pages/home.blade.php');
$viewContent = file_get_contents($viewPath);
expect($viewContent)->toContain('text-2xl sm:text-3xl lg:text-4xl');
});
test('public layout has responsive padding', function () {
$viewPath = resource_path('views/components/layouts/public.blade.php');
$viewContent = file_get_contents($viewPath);
expect($viewContent)->toContain('px-4 sm:px-6 lg:px-8');
});
});
describe('Posts Responsive', function () {
test('posts list has responsive styling', function () {
$viewPath = resource_path('views/livewire/pages/posts/index.blade.php');
$viewContent = file_get_contents($viewPath);
expect($viewContent)->toContain('p-4 sm:p-6');
});
test('posts list uses empty-state class', function () {
$viewPath = resource_path('views/livewire/pages/posts/index.blade.php');
$viewContent = file_get_contents($viewPath);
expect($viewContent)->toContain('empty-state');
});
test('posts read more link is touch-friendly', function () {
$viewPath = resource_path('views/livewire/pages/posts/index.blade.php');
$viewContent = file_get_contents($viewPath);
expect($viewContent)->toContain('min-h-[44px]');
});
});
describe('Consultations Page Responsive', function () {