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
+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);
});