// presses.test.mjs — the browser's presses against the server's, through // the shared vectors (vectors/presses.json, which // internal/slides/deck/presses_test.go reads too). import { test } from 'node:test' import assert from 'node:assert/strict' import { readFileSync } from 'node:fs' import { presses } from './presses.mjs' const vectors = JSON.parse(readFileSync(new URL('./vectors/presses.json', import.meta.url))) test('presses vectors', async t => { assert.ok(vectors.length >= 10) for (const c of vectors) { await t.test(c.name, () => { assert.deepEqual(presses(c.slide, c.scenes), c.presses) }) } }) test('a slide with no blocks key has no presses', () => { assert.deepEqual(presses({ id: 's' }), []) })