Files
coolify/tests/Feature/MenuItemActiveNoBorderTest.php
Andras Bacsai a7a06aa6c8 feat(ui): polish domains, storage, env vars and resource nav
Improve project resource UIs: sort domains by DNS failure, stop re-adding www pairs on refresh, lazy-load storage tabs with counts, tighten env-var tables, keep application tabs active across Livewire polls, unify database type labels, and update related CSS/JS and tests.
2026-08-05 13:50:11 +02:00

27 lines
1.1 KiB
PHP

<?php
/**
* Active sidebar/nav items use a solid fill only — no left accent rail
* (::before) and no gradient wash.
*/
test('active menu items do not render an accent rail', function () {
$appCss = file_get_contents(resource_path('css/app.css'));
$utilities = file_get_contents(resource_path('css/utilities.css'));
preg_match('/@utility menu-item-active \{[^}]*\}/s', $utilities, $menuItemActive);
preg_match('/@utility menu-subitem-active \{[^}]*\}/s', $utilities, $menuSubitemActive);
expect($menuItemActive[0] ?? '')
->toContain('rounded-md')
->toContain('bg-black/[0.05]')
->and($menuSubitemActive[0] ?? '')
->toContain('rounded-md')
->toContain('bg-black/[0.05]');
// Accent rail must be disabled (content: none), not drawn as a 3px accent bar.
expect($appCss)
->toMatch('/\.menu-item-active::before,\s*\.menu-subitem-active::before\s*\{[^}]*content:\s*none/s')
->not->toMatch('/\.menu-item-active::before\s*\{[^}]*width:\s*3px/s')
->not->toMatch('/\.menu-item-active::before\s*\{[^}]*background:\s*var\(--color-accent\)/s');
});