1
0
forked from baron/baron-sso

문자 인증 잔여 익셉션/창 안꺼짐 fix

This commit is contained in:
2026-05-21 17:54:36 +09:00
parent c4f8d939d2
commit 66687a4c73
3 changed files with 251 additions and 14 deletions

View File

@@ -138,12 +138,6 @@ test.describe('UserFront login performance budget', () => {
expect(warm.transferredBytes).toBeLessThanOrEqual(1_000_000);
expectNoDuplicateStaticRequests(cold);
expectNoDuplicateStaticRequests(warm);
expect(
cold.requestedUrls.some((url) =>
url.endsWith('/flutter_service_worker.js'),
),
).toBe(false);
const cacheControlByPath = new Map([
...cold.cacheControlByPath,
...warm.cacheControlByPath,
@@ -155,6 +149,41 @@ test.describe('UserFront login performance budget', () => {
const appShellCache = cacheControlByPath.get('/ko/signin') ?? '';
expect(appShellCache).toContain('no-cache');
const serviceWorkerState = await page.evaluate(async () => {
if (!('serviceWorker' in navigator)) {
return {
available: false,
secure: window.isSecureContext,
scriptUrl: '',
};
}
const registrations = await navigator.serviceWorker.getRegistrations();
const registration = registrations[0];
return {
available: true,
secure: window.isSecureContext,
count: registrations.length,
controller: navigator.serviceWorker.controller?.scriptURL ?? '',
scriptUrl:
registration?.active?.scriptURL ??
registration?.waiting?.scriptURL ??
registration?.installing?.scriptURL ??
'',
};
});
if (testInfo.project.name.includes('mobile')) {
expect(new URL(serviceWorkerState.scriptUrl).pathname).toBe(
'/flutter_service_worker.js',
);
const serviceWorkerResponse = await page.context().request.get(
new URL('/flutter_service_worker.js', page.url()).toString(),
);
expect(serviceWorkerResponse.headers()['cache-control'] ?? '').toContain(
'no-cache',
);
} else {
expect(serviceWorkerState.scriptUrl).toBe('');
}
expect(cold.durationMs).toBeGreaterThanOrEqual(0);
});