test: comprehensive test suites and quality gates pass across backend, storefront and admin
- Backend (NestJS): 82 suites, 641 tests passing; 0 ESLint errors; 0 tsc errors. Hardened SSL cert/key matching, SSRF IP pinning, and eBank validation. - Admin Panel (Vite/React): 48 suites, 300 tests passing; 0 ESLint errors; 0 tsc errors. Full coverage across all pages and settings. - Storefront (Next.js): 62 suites, 368 tests passing; 0 ESLint errors; 0 tsc errors. - Fixed unmount lifecycle guards, promise error handling, and component edge cases.
This commit is contained in:
1 parent
1e73715169
commit
ddbf1ca026
439 files changed
+32911
-6107
No files matched your search
@@ -70,7 +70,8 @@ export default function AnalyticsDeferred({ gtmId, gaId, clarityId }: AnalyticsD
|
||||
t.async = 1;
|
||||
t.src = 'https://www.clarity.ms/tag/' + i;
|
||||
const y = l.getElementsByTagName(r)[0];
|
||||
y.parentNode.insertBefore(t, y);
|
||||
if (y?.parentNode) y.parentNode.insertBefore(t, y);
|
||||
else l.head.appendChild(t);
|
||||
})(window, document, 'clarity', 'script', clarityId);
|
||||
}
|
||||
};
|
||||
@@ -82,16 +83,19 @@ export default function AnalyticsDeferred({ gtmId, gaId, clarityId }: AnalyticsD
|
||||
window.addEventListener('keydown', loadAnalytics, { passive: true, once: true });
|
||||
|
||||
// Fallback: idle execution after 3.5s
|
||||
let idleId: number | undefined;
|
||||
const timer = setTimeout(() => {
|
||||
if (typeof window !== 'undefined' && 'requestIdleCallback' in window) {
|
||||
(window as any).requestIdleCallback(loadAnalytics, { timeout: 2000 });
|
||||
idleId = window.requestIdleCallback(loadAnalytics, { timeout: 2000 });
|
||||
} else {
|
||||
loadAnalytics();
|
||||
}
|
||||
}, 3500);
|
||||
|
||||
return () => {
|
||||
loaded = true;
|
||||
clearTimeout(timer);
|
||||
if (idleId !== undefined) window.cancelIdleCallback(idleId);
|
||||
window.removeEventListener('scroll', loadAnalytics);
|
||||
window.removeEventListener('touchstart', loadAnalytics);
|
||||
window.removeEventListener('mousemove', loadAnalytics);
|
||||
|
||||
Reference in new issue
Block a user