libra/tests/Feature/Public/HomePageTest.php

158 lines
4.6 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
test('home page is accessible', function () {
$this->get('/')
->assertOk();
});
test('home page displays English tagline when locale is English', function () {
$this->withSession(['locale' => 'en'])
->get('/')
->assertOk()
->assertSee('Committed to Justice Grounded in Dignity Driven to Advocate');
});
test('home page displays Arabic tagline when locale is Arabic', function () {
$this->withSession(['locale' => 'ar'])
->get('/')
->assertOk()
->assertSee('ملتزمون بالعدالة متجذرون بالكرامة مدفوعون للدفاع');
});
test('home page displays English intro text when locale is English', function () {
$this->withSession(['locale' => 'en'])
->get('/')
->assertOk()
->assertSee('Libra for Rights is a legal institution woven from the fabric of society');
});
test('home page displays Arabic intro text when locale is Arabic', function () {
$this->withSession(['locale' => 'ar'])
->get('/')
->assertOk()
->assertSee('ليبرا للحقوق مؤسسة قانونية منسوجة من نسيج المجتمع');
});
test('home page displays Book a Consultation button in English', function () {
$this->withSession(['locale' => 'en'])
->get('/')
->assertOk()
->assertSee('Book a Consultation');
});
test('home page displays Book a Consultation button in Arabic', function () {
$this->withSession(['locale' => 'ar'])
->get('/')
->assertOk()
->assertSee('احجز استشارة');
});
test('home page displays Our Services button in English', function () {
$this->withSession(['locale' => 'en'])
->get('/')
->assertOk()
->assertSee('Our Services');
});
test('home page displays Our Services button in Arabic', function () {
$this->withSession(['locale' => 'ar'])
->get('/')
->assertOk()
->assertSee('خدماتنا');
});
test('home page contains link to booking page', function () {
$this->get('/')
->assertOk()
->assertSee('href="'.route('booking').'"', false);
});
test('home page contains link to services section', function () {
$this->get('/')
->assertOk()
->assertSee('href="#services"', false);
});
test('home page contains services section with id', function () {
$this->get('/')
->assertOk()
->assertSee('id="services"', false);
});
// 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('/')
->assertOk()
->assertSee('Meet the Founder');
});
test('home page displays about section title in Arabic', function () {
$this->withSession(['locale' => 'ar'])
->get('/')
->assertOk()
->assertSee('تعرف على المؤسِّسة');
});
test('home page displays lawyer name in English', function () {
$this->withSession(['locale' => 'en'])
->get('/')
->assertOk()
->assertSee('Huda Armouche');
});
test('home page displays lawyer name in Arabic', function () {
$this->withSession(['locale' => 'ar'])
->get('/')
->assertOk()
->assertSee('هدى عرموش');
});
test('home page displays lawyer title in English', function () {
$this->withSession(['locale' => 'en'])
->get('/')
->assertOk()
->assertSee('Attorney at Law');
});
test('home page displays lawyer title in Arabic', function () {
$this->withSession(['locale' => 'ar'])
->get('/')
->assertOk()
->assertSee('محامية');
});
test('home page displays lawyer bio in English', function () {
$this->withSession(['locale' => 'en'])
->get('/')
->assertOk()
->assertSee('Huda Armouche founded Libra for Rights');
});
test('home page displays lawyer bio in Arabic', function () {
$this->withSession(['locale' => 'ar'])
->get('/')
->assertOk()
->assertSee('أسست هدى عرموش ليبرا للحقوق');
});
test('home page displays lawyer photo', function () {
$this->get('/')
->assertOk()
->assertSee('images/huda-armouche.jpg', false);
});
test('home page lawyer photo has alt text for accessibility', function () {
$this->withSession(['locale' => 'en'])
->get('/')
->assertOk()
->assertSee('alt="Huda Armouche"', false);
});