TenantAtlas/tests/Feature/Filament/UnhandledRejectionLoggerAssetTest.php
2026-03-24 20:04:41 +01:00

21 lines
745 B
PHP

<?php
declare(strict_types=1);
it('injects the unhandled rejection logger into Filament pages', function (): void {
$this->get('/admin/login')
->assertSuccessful()
->assertSee('js/tenantpilot/unhandled-rejection-logger.js', escape: false);
});
it('ships a window unhandledrejection logger with structured payload output', function (): void {
$js = file_get_contents(public_path('js/tenantpilot/unhandled-rejection-logger.js'));
expect($js)->toBeString();
expect($js)
->toContain('__tenantpilotUnhandledRejectionLoggerApplied')
->toContain("window.addEventListener('unhandledrejection'")
->toContain('TenantPilot unhandled promise rejection')
->toContain('JSON.stringify');
});