X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/da1a66abd384911085d595e4ef06d36430a38a27..refs/pull/5280/head:/tests/Settings/SettingsTest.php diff --git a/tests/Settings/SettingsTest.php b/tests/Settings/SettingsTest.php index 30bb50f7c..9d45706e7 100644 --- a/tests/Settings/SettingsTest.php +++ b/tests/Settings/SettingsTest.php @@ -6,6 +6,11 @@ use Tests\TestCase; class SettingsTest extends TestCase { + public function test_admin_can_see_settings() + { + $this->asAdmin()->get('/settings/features')->assertSee('Settings'); + } + public function test_settings_endpoint_redirects_to_settings_view() { $resp = $this->asAdmin()->get('/settings'); @@ -52,6 +57,10 @@ class SettingsTest extends TestCase $this->assertFalse(setting()->get('app-icon-128')); $this->assertFalse(setting()->get('app-icon-64')); $this->assertFalse(setting()->get('app-icon-32')); + $this->assertEquals( + file_get_contents(public_path('icon.ico')), + file_get_contents(public_path('favicon.ico')), + ); $prevFileCount = count(glob(dirname($expectedPath) . DIRECTORY_SEPARATOR . '*.png')); @@ -71,6 +80,11 @@ class SettingsTest extends TestCase $resp = $this->get('/'); $this->withHtml($resp)->assertElementCount('link[sizes][href*="my-app-icon"]', 6); + $this->assertNotEquals( + file_get_contents(public_path('icon.ico')), + file_get_contents(public_path('favicon.ico')), + ); + $reset = $this->post('/settings/customization', ['app_icon_reset' => 'true']); $reset->assertRedirect('/settings/customization'); @@ -81,5 +95,10 @@ class SettingsTest extends TestCase $this->assertFalse(setting()->get('app-icon-128')); $this->assertFalse(setting()->get('app-icon-64')); $this->assertFalse(setting()->get('app-icon-32')); + + $this->assertEquals( + file_get_contents(public_path('icon.ico')), + file_get_contents(public_path('favicon.ico')), + ); } }