@@ -29,4 +29,25 @@ class SitePagesTest extends TestCase
|
||||
->assertOk()
|
||||
->assertInertia(fn (Assert $page) => $page->component($component));
|
||||
}
|
||||
|
||||
public function test_site_defaults_to_indonesian()
|
||||
{
|
||||
$this->get(route('home'))
|
||||
->assertInertia(fn (Assert $page) => $page->where('locale', 'id'));
|
||||
}
|
||||
|
||||
public function test_locale_cookie_switches_the_site_to_english()
|
||||
{
|
||||
$this->withUnencryptedCookie('locale', 'en')
|
||||
->get(route('home'))
|
||||
->assertSee('<html lang="en"', false)
|
||||
->assertInertia(fn (Assert $page) => $page->where('locale', 'en'));
|
||||
}
|
||||
|
||||
public function test_unsupported_locale_cookie_falls_back_to_indonesian()
|
||||
{
|
||||
$this->withUnencryptedCookie('locale', 'fr')
|
||||
->get(route('home'))
|
||||
->assertInertia(fn (Assert $page) => $page->where('locale', 'id'));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user