1
0

feat(js): enforce global lifecycle hard-cuts and helpdesk list adapter

This commit is contained in:
2026-04-20 23:01:54 +02:00
parent c163393cc4
commit c3de7d4238
5 changed files with 171 additions and 38 deletions

View File

@@ -21,6 +21,19 @@ final class FrontendJsContractsTest extends TestCase
$this->assertSame([], $violations, "window.alert usage found in frontend JS scope:\n" . implode("\n", $violations));
}
public function testFrontendJsDoesNotUseDomReadyAutoInitPatterns(): void
{
$violations = $this->findPatternMatchesInFiles('web/js', '/DOMContentLoaded|document\.readyState/', ['js']);
foreach ($this->moduleJsDirectories() as $moduleJsDir) {
$violations = array_merge($violations, $this->findPatternMatchesInFiles($moduleJsDir, '/DOMContentLoaded|document\.readyState/', ['js']));
}
$violations = array_values(array_unique($violations));
sort($violations);
$this->assertSame([], $violations, "DOM-ready auto-init pattern found in frontend JS scope:\n" . implode("\n", $violations));
}
public function testHelpdeskRuntimeComponentsDoNotAutoInitialize(): void
{
foreach ($this->helpdeskRuntimeComponentFiles() as $file) {