test(atlas): cover the new Atlas from engine to hub views

SonarCloud measured 16.9% coverage on this PR's new code. Tests now cover the WebGL globe engine (boot, caching, input, camera, regions, prefetch) and renderer (against a fake WebGL2 context that reads the real shaders), the paint, labels, sky and pins, the central useAtlasGlobe hook and the hub hooks, the snapshot, account queue and Atlas repos, every desktop and phone hub view, the server's people, flights and mesh routes, the shared badge rules, and the new view transition, warm bags and kept planner maps.
This commit is contained in:
Maurice
2026-11-29 10:21:28 +01:00
parent 10ad92574d
commit 9018ee8980
69 changed files with 14979 additions and 0 deletions
+30
View File
@@ -0,0 +1,30 @@
// FE-ATLAS2-DATA-080 to FE-ATLAS2-DATA-082: the replay rules both write queues share.
import { describe, expect, it } from 'vitest';
import {
BUILD_VERSION,
isRetryableStatus,
MAX_SERVER_ERROR_ATTEMPTS,
SERVER_ERROR_BACKOFF_MS,
STUCK_SYNCING_MS,
} from './queuePolicy';
describe('queuePolicy', () => {
it('FE-ATLAS2-DATA-080: only an expired login, a timeout, too-early and rate limiting are worth waiting out', () => {
for (const status of [401, 408, 425, 429]) expect(isRetryableStatus(status)).toBe(true);
for (const status of [undefined, 200, 400, 403, 404, 409, 422, 500, 503])
expect(isRetryableStatus(status)).toBe(false);
});
it('FE-ATLAS2-DATA-081: the gap doubles from 30 s up to 32 minutes before the last server-error try', () => {
expect(MAX_SERVER_ERROR_ATTEMPTS).toBe(8);
expect(SERVER_ERROR_BACKOFF_MS).toBe(30_000);
const lastGap = SERVER_ERROR_BACKOFF_MS * 2 ** (MAX_SERVER_ERROR_ATTEMPTS - 2);
expect(lastGap).toBe(32 * 60_000);
expect(STUCK_SYNCING_MS).toBe(60_000);
});
it('FE-ATLAS2-DATA-082: the build stamp is a string, empty where the bundler defined none', () => {
expect(typeof BUILD_VERSION).toBe('string');
});
});