- $this->asEditor();
- $this->assertFalse(config('app.rtl'), "App RTL config should be false by default");
- setting()->putUser($this->getEditor(), 'language', 'ar');
- $this->get('/');
- $this->assertTrue(config('app.rtl'), "App RTL config should have been set to true by middleware");
+ $this->asEditor()->withHtml($this->get('/'))->assertElementExists('html[dir="ltr"]');
+
+ setting()->putUser($this->users->editor(), 'language', 'ar');
+
+ $this->withHtml($this->get('/'))->assertElementExists('html[dir="rtl"]');
+ }
+
+ public function test_unknown_lang_does_not_break_app()
+ {
+ config()->set('app.locale', 'zz');
+
+ $loginReq = $this->get('/login', ['Accept-Language' => 'zz']);
+ $loginReq->assertOk();
+ $loginReq->assertSee('Log In');