Files
coolify/tests/Feature/NavigationCloakTest.php
T
Andras Bacsai 5acf4d9af2 fix(navigation): strip stale x-cloak after Livewire navigation
Remove leftover x-cloak attributes after wire:navigate events so morphed
pages do not stay hidden, while keeping the initial-load cloak guard covered
by a feature test.
2026-06-02 17:00:55 +02:00

17 lines
555 B
PHP

<?php
it('strips leftover x-cloak after wire:navigate to prevent blank page', function () {
$appJs = file_get_contents(resource_path('js/app.js'));
expect($appJs)
->toContain("document.addEventListener('livewire:navigated'")
->toContain("querySelectorAll('[x-cloak]')")
->toContain("removeAttribute('x-cloak')");
});
it('keeps the initial-load x-cloak guard on the app wrapper', function () {
$layout = file_get_contents(resource_path('views/layouts/app.blade.php'));
expect($layout)->toContain('x-cloak');
});