Commit Graph

1 Commits

Author SHA1 Message Date
you e106cd1f7f test: add 64 unit tests for packets.js via vm.createContext
Expose pure functions from packets.js IIFE via window._packetsTestAPI
and test them comprehensively in test-packets.js:

- typeName: type code to name mapping (2 tests)
- obsName: observer name lookup (2 tests)
- kv/sectionRow/fieldRow: HTML helper functions (3 tests)
- getDetailPreview: all packet type previews (17 tests)
- getPathHopCount: path JSON parsing (4 tests)
- sortGroupChildren: group sorting + header update (3 tests)
- renderTimestampCell: timestamp rendering (2 tests)
- renderPath: hop path rendering (3 tests)
- renderDecodedPacket: full decoded packet HTML (6 tests)
- buildFieldTable: field table for all payload types (11 tests)
- _getRowCount: virtual scroll row counting (1 test)
- buildFlatRowHtml: flat row rendering (3 tests)
- buildGroupRowHtml: grouped row rendering (3 tests)
- Test API exposure verification (1 test)

Part of #344 — packets.js coverage
2026-04-02 08:07:29 +00:00