mirror of
https://github.com/BookStackApp/BookStack.git
synced 2026-10-12 10:09:58 +00:00
Set to blank if text is already part of the header, and the app name if the name is not shown in the header. For #6171 References: https://webaim.org/techniques/alttext/ https://www.scottohara.me/blog/2018/05/05/hidden-vs-none.html
33 lines
843 B
PHP
33 lines
843 B
PHP
<?php
|
|
|
|
namespace Tests\View;
|
|
|
|
use Tests\TestCase;
|
|
|
|
class HeaderBarTest extends TestCase
|
|
{
|
|
public function test_header_logo_alt_tag_blank_when_used_with_app_name()
|
|
{
|
|
$this->setSettings([
|
|
'app-name' => 'Dino Docs',
|
|
'app-logo' => '',
|
|
'app-name-header' => true,
|
|
]);
|
|
|
|
$resp = $this->get('/login');
|
|
$this->withHtml($resp)->assertElementExists('header img.logo-image[alt=""]');
|
|
}
|
|
|
|
public function test_header_logo_alt_tag_uses_app_name_when_name_not_shown_in_header()
|
|
{
|
|
$this->setSettings([
|
|
'app-name' => 'Dino Docs',
|
|
'app-logo' => '',
|
|
'app-name-header' => false,
|
|
]);
|
|
|
|
$resp = $this->get('/login');
|
|
$this->withHtml($resp)->assertElementExists('header img.logo-image[alt="Dino Docs"]');
|
|
}
|
|
}
|