// presence-view.mjs's one pure piece: format(), the catalog // interpolation every label (avatar, "+N", the block chip, the // arrival/departure line) goes through. The rest of the module reads // getBoundingClientRect and ResizeObserver, which is the browser // drive's job (internal/slidestest/browser_test.go): two contexts, // each seeing the other's avatar and outline for real. import test from 'node:test' import assert from 'node:assert/strict' import { format } from './presence-view.mjs' test('format: {name} and {n} interpolate; an unknown key is left as text', () => { assert.equal(format('{name} is on this slide', { name: 'Ana Ruiz' }), 'Ana Ruiz is on this slide') assert.equal(format('{n} more people on this slide', { n: 2 }), '2 more people on this slide') assert.equal(format('{who} said hi', { name: 'Ana' }), '{who} said hi') assert.equal(format('', { name: 'Ana' }), '') assert.equal(format(undefined, {}), '') })