bend_puzzle/test/v4798-startup-version-retry-smoke-test.js
33333-33333 9d70afb4cc
Some checks failed
BEND FIELD CI / release (push) Has been cancelled
BEND FIELD CI / production-bridge (push) Has been cancelled
t
2026-08-01 22:31:04 +09:00

19 lines
2.6 KiB
JavaScript

'use strict';
const assert=require('assert/strict');
const {read,functionSource}=require('./helpers/app-source');
const app=read('app.js'),server=read('server.js'),service=read('scripts/service-control.js');
assert(functionSource('fetchCurrentSharedWorldStatus').includes('status.appVersion===APP_VERSION'),'Startup does not verify the running server release');
assert(functionSource('fetchCurrentSharedWorldStatus').includes('npm start'),'Version mismatch does not provide the correct server restart action');
assert(functionSource('runStatusRetry').includes('statusRetryAction')&&functionSource('runStatusRetry').includes('await action()'),'Retry does not rerun the selected connection action');
assert(!app.includes('復元用バックアップがありません。')&&!app.includes("onclick=retryRecovery"),'Startup retry can still enter obsolete backup recovery');
assert(server.includes('appVersion:BuildMeta.APP_VERSION'),'Cloud status does not identify the server release');
assert(functionSource('initCloudSync').includes('await activateSingleSharedClientCache()'),'Startup does not activate the new server-authoritative client cache epoch');
assert(functionSource('initCloudSync').includes('stateIds:Object.keys(data.states)'),'Initial board state is omitted from the first shared-world commit');
assert(functionSource('initCloudSync').includes("persistNow({skipCloud:true})"),'Initial shared board is read from IndexedDB before the new epoch is committed');
assert(functionSource('mergeGlobalFields').includes('Math.max'),'Incremental shared-world pulls do not have a defined global merge path');
assert(functionSource('pullCloudWorld').includes('cloudSyncing=false;setCloudStatus()')&&functionSource('pushCloudPending').includes('cloudSyncing=false;setCloudStatus()'),'Shared indicator can remain stuck in the syncing state');
assert(functionSource('disconnectRealtimeForLifecycle').includes('keepalive:true'),'HTTP polling presence is not disconnected when the page closes');
assert(read('realtime-server.js').includes("claim.ownerPresenceId === client.id")&&read('realtime-server.js').includes("releaseBoardClaim(boardId, 'disconnected')"),'Disconnected clients can retain board claims');
assert(service.includes('Replacing the running LinkField server')&&functionSource('start',service).indexOf('deployPublicFiles()')<functionSource('start',service).indexOf('await stop({quiet:true})')&&functionSource('deployPublicFiles',service).includes('fsp.rename(stage,publicDir)'),'npm start does not stage and atomically publish before replacing the managed server');
console.log('LinkField v48.0 startup version and retry regression test passed');