Align mail columns and add live sync dialogs with targeted cancellation

This commit is contained in:
alberto committed 2026-10-17 09:57:34 +02:00
1 parent e536f0939c
commit 573e0aa24e
15 files changed
+133 -20

No files matched your search

+4
View File
@@ -28,6 +28,10 @@ test('packet controller reservation verifies acknowledgement and releases its ow
const client={job:{},persist:async()=>writeFile(controller.statusFile,JSON.stringify({manualRequestId:client.job.controller.id,phase:'vhf',pttReady:true,frequency:'433.750',at:new Date().toISOString()})),fwd:{bpq:async url=>{urls.push(url);return 'Connected to TNC AFSK AX.25 1200bd';}}};
try{await reservePacketSlot(client,controller,433.750,3);assert.deepEqual(urls,['/Node/Port?3']);const request=JSON.parse(await readFile(controller.requestFile));assert.equal(request.frequencyMHz,433.750);assert.ok(request.expiresAt>Date.now());await releasePacketSlot(client);assert.equal(JSON.parse(await readFile(controller.requestFile)).expiresAt,0);}finally{await rm(dir,{recursive:true,force:true});}
});
test('a cancelled packet preparation cannot dispatch a radio call',async()=>{
const abort=new AbortController();abort.abort();let touched=false;
await assert.rejects(reservePacketSlot({persist:async()=>{touched=true;}},{requestFile:'unused',statusFile:'unused'},144.825,3,{signal:abort.signal}),{name:'AbortError'});assert.equal(touched,false);
});
test('temporary RMS profile preserves routing, disables timers and never overrides busy channel',()=>{const p=radioProfile(original,channel,3);assert.equal(p.Enabled,'0');assert.equal(p.ConnectScript,'ATTACH 3|RADIO 14.122000 USB|PAUSE 2|C N0TEST');assert.ok(!p.ConnectScript.includes('OVERRIDEBUSY'));assert.equal(p.UseB2Protocol,'1');assert.equal(p.HRoutes,original.HRoutes);assert.equal(p.TOCalls,original.TOCalls);assert.deepEqual(rawProfile(configText(original),'RMS'),original);assert.equal(profilePayload(original).split('|').length,21);assert.throws(()=>radioProfile(original,{...channel,call:'N0TEST|C EVIL'},3));assert.throws(()=>radioProfile(original,{...channel,dialHz:0},3));assert.deepEqual(activeMailStreams('<option value=1>Idle&nbsp; </option>'),[]);assert.equal(activeMailStreams('<option value=1>RMS N0TEST Connected</option>').length,1);assert.throws(()=>activeMailStreams('signin page'));});
test('public directory download uses viewstate and PUBLIC mode, caches, and rejects stale selection',async()=>{
const dir=await mkdtemp(path.join(os.tmpdir(),'wl-directory-'));const calls=[];const now=new Date();const stamp=`${now.getUTCMonth()+1}/${now.getUTCDate()}/${now.getUTCFullYear()} ${now.getUTCHours()%12||12}:${String(now.getUTCMinutes()).padStart(2,'0')}:00 ${now.getUTCHours()<12?'AM':'PM'}`;const liveCsv=csv.replace('10/16/2026 3:29:00 PM',stamp);