1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2026-01-03 23:42:28 +03:00

Added tests and translations for dark-mode components

This commit is contained in:
Dan Brown
2020-04-11 20:44:23 +01:00
parent 573c848d51
commit 50669e3f4a
3 changed files with 21 additions and 2 deletions

View File

@@ -75,4 +75,21 @@ class UserPreferencesTest extends TestCase
$invalidKeyRequest = $this->patch('/settings/users/' . $editor->id.'/update-expansion-preference/my-home-details', ['expand' => 'true']);
$invalidKeyRequest->assertStatus(500);
}
public function test_toggle_dark_mode()
{
$home = $this->actingAs($this->getEditor())->get('/');
$home->assertElementNotExists('.dark-mode');
$home->assertSee('Dark Mode');
$this->assertEquals(false, setting()->getForCurrentUser('dark-mode-enabled', false));
$prefChange = $this->patch('/settings/users/toggle-dark-mode');
$prefChange->assertRedirect();
$this->assertEquals(true, setting()->getForCurrentUser('dark-mode-enabled'));
$home = $this->actingAs($this->getEditor())->get('/');
$home->assertElementExists('.dark-mode');
$home->assertDontSee('Dark Mode');
$home->assertSee('Light Mode');
}
}