Symbole für alle Hauptpunkte im automatischen Menü (0.40.0)
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 8m25s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 8m46s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 11m36s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 11m31s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 11m34s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 12m12s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 12m14s
CI / Bekannte Sicherheitslücken in Paketen (pull_request) Successful in 46s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 11m18s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m15s

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Friederich Loheide 2026-09-27 18:02:11 +00:00
parent a704d12d2a
commit 8a9399b6a5
21 changed files with 102 additions and 29 deletions

View file

@ -45,6 +45,25 @@ class MenuTest extends TestCase
$this->assertContains('news', $keys);
}
public function test_every_top_level_item_of_the_automatic_menu_has_an_icon(): void
{
$navigation = app(Navigation::class);
$navigation->add('eigenes-plugin', 'Eigenes', '/eigenes', sort: 99);
$navigation->add('mit-symbol', 'Mit Symbol', '/mit', sort: 98, icon: 'rocket');
$navigation->add('falsches-symbol', 'Falsch', '/falsch', sort: 97, icon: 'gibt-es-nicht');
$this->page('Leitbild')->forceFill(['in_navigation' => true])->save();
$menu = collect($this->menuFor(User::factory()->admin()->create()))->keyBy('key');
$this->assertTrue($menu->every(fn ($item) => filled($item['icon'])), 'Jeder Hauptpunkt hat ein Symbol');
$this->assertSame('house', $menu['home']['icon']);
$this->assertSame('newspaper', $menu['news']['icon']);
$this->assertSame('rocket', $menu['mit-symbol']['icon']);
$this->assertSame(Navigation::FALLBACK_ICON, $menu['eigenes-plugin']['icon']);
$this->assertSame(Navigation::FALLBACK_ICON, $menu['falsches-symbol']['icon']);
$this->assertSame('file-text', $menu->first(fn ($i) => str_starts_with($i['key'], 'page-'))['icon']);
}
public function test_custom_menu_with_pages_subpages_groups_links_and_roles(): void
{
$mav = $this->page('Mitarbeitervertretung');
@ -101,6 +120,7 @@ class MenuTest extends TestCase
$component = Livewire::test(MenuSettings::class);
$items = $component->get('data.items');
$this->assertSame('home', collect($items)->first()['module']);
$this->assertSame('house', collect($items)->first()['icon'], 'Symbole des automatischen Menüs werden übernommen');
$component->set('data.items', [
'x' => ['id' => 'x', 'type' => 'module', 'module' => 'news', 'label' => 'News', 'icon' => 'newspaper', 'roles' => [], 'children' => [