Complete room UI and protocol integration, move game definitions and resources behind bundle entries, publish authoritative version XML, and document single-game builds. Include all current resource changes and experiment artifacts.
25 lines
1.6 KiB
TypeScript
25 lines
1.6 KiB
TypeScript
import test from 'node:test';
|
|
import assert from 'node:assert/strict';
|
|
import {RoomHudClock,roomHudCycles,roomHudTime} from '../../YouleNexus/assets/framework/presentation/room-hud-model.ts';
|
|
|
|
test('local clock pads both fields and cycles ordinary rooms each five seconds',()=>{
|
|
assert.deepEqual(roomHudTime(new Date(2026,0,1,3,4)),{hours:'03',minutes:'04'});
|
|
const clock=new RoomHudClock();clock.update(4,true,true);assert.equal(clock.showRoomCode,false);
|
|
clock.update(1,true,true);assert.equal(clock.showRoomCode,true);
|
|
clock.update(5,true,true);assert.equal(clock.showRoomCode,false);
|
|
});
|
|
test('hidden149 gates elapsed time and infinite/match rooms do not cycle',()=>{
|
|
const clock=new RoomHudClock();clock.update(10,false,true);assert.equal(clock.showRoomCode,false);assert.equal(clock.colonOpacity,255);
|
|
clock.update(1,true,false);assert.equal(clock.colonOpacity,100);
|
|
clock.update(9,true,false);assert.equal(clock.showRoomCode,false);assert.equal(clock.colonOpacity,255);
|
|
assert.equal(roomHudCycles({infinite:1,matchId:null}),false);
|
|
assert.equal(roomHudCycles({infinite:0,matchId:234}),false);
|
|
assert.equal(roomHudCycles({infinite:0,matchId:null}),true);
|
|
assert.equal(roomHudCycles({infinite:0,matchId:0}),true);
|
|
});
|
|
test('reset releases prior room clock state and large elapsed steps preserve parity',()=>{
|
|
const clock=new RoomHudClock();clock.update(15,true,true);assert.equal(clock.showRoomCode,true);
|
|
clock.reset();assert.equal(clock.showRoomCode,false);assert.equal(clock.colonOpacity,255);
|
|
clock.update(20,true,true);assert.equal(clock.showRoomCode,false);assert.equal(clock.colonOpacity,255);
|
|
});
|