mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-08-07 23:03:00 +03:00
Split out settings view and made functional
- Split settings out to new views using a core shared layout. - Extracted added language text to translation files. - Updated settings routes to be dynamic to category. - Added redirect for old primary settings route. - Updated existing tests to cover settings route changes. - Added tests to cover settings view. - Improved contrast of settings links for dark mode.
This commit is contained in:
31
tests/Settings/SettingsTest.php
Normal file
31
tests/Settings/SettingsTest.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Settings;
|
||||
|
||||
use Tests\TestCase;
|
||||
|
||||
class SettingsTest extends TestCase
|
||||
{
|
||||
public function test_settings_endpoint_redirects_to_settings_view()
|
||||
{
|
||||
$resp = $this->asAdmin()->get('/settings');
|
||||
|
||||
$resp->assertRedirect('/settings/features');
|
||||
}
|
||||
|
||||
public function test_settings_category_links_work_as_expected()
|
||||
{
|
||||
$this->asAdmin();
|
||||
$categories = [
|
||||
'features' => 'Features & Security',
|
||||
'customization' => 'Customization',
|
||||
'registration' => 'Registration',
|
||||
];
|
||||
|
||||
foreach ($categories as $category => $title) {
|
||||
$resp = $this->get("/settings/{$category}");
|
||||
$resp->assertElementContains('h1', $title);
|
||||
$resp->assertElementExists("form[action$=\"/settings/{$category}\"]");
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user