ViewersRun takes the rows of Java's viewers from the firmware: a switch's table, a home router's NAT table, each after its reset, and the frames "Pakete verwerfen" drops while it is held. The core writes a frame as Java does and resets the NAT's dynamic entries; the room sends both tables as views, drops while any client holds the button, and sends the dropped frames, begun anew with each start, with the clock their times of day are written from; the editor opens a table with a tap on a switch or home router and holds "Pakete verwerfen" in its toolbar, which now wraps on a phone. This completes F4.6. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
17 lines
720 B
TypeScript
17 lines
720 B
TypeScript
// A simulation time as Java's viewers write the wall clock: HH:mm:ss, and
|
|
// with milliseconds for the dropped frames (Lauscher.formatTimestamp), in the
|
|
// viewer's time zone.
|
|
|
|
import { describe, expect, it } from 'vitest';
|
|
import { timeOfDay } from '../src/simulation/timeOfDay.js';
|
|
|
|
describe('a time of day', () => {
|
|
it('pads hours, minutes, seconds and milliseconds as Java does', () => {
|
|
const clock = new Date(2026, 9, 3, 7, 5, 3, 4).getTime();
|
|
expect(timeOfDay(clock, 0)).toBe('07:05:03');
|
|
expect(timeOfDay(clock, 0, true)).toBe('07:05:03.004');
|
|
expect(timeOfDay(clock, 56_996 + 3_600_000 * 15, true)).toBe('22:06:00.000');
|
|
expect(timeOfDay(clock, 96, true)).toBe('07:05:03.100');
|
|
});
|
|
});
|