1import test from 'node:test';2import assert from 'node:assert/strict';3import { SCENE_MOTION_TIMING, sceneMotionExitFrame, sceneMotionPhase } from '../src/stage/scene-motion.js';45test('scene motion opens, settles, and exits on the shared timing contract', () => {6 assert.equal(sceneMotionPhase({ now: 0, openedAt: 0 }).phase, 'opening');7 assert.equal(sceneMotionPhase({ now: SCENE_MOTION_TIMING.entry, openedAt: 0 }).phase, 'settled');8 const exiting = sceneMotionPhase({ now: 70, exitStartedAt: 0 });9 assert.equal(exiting.phase, 'exiting');10 assert.equal(exiting.shutterProgress, 0.5);11 assert.equal(sceneMotionPhase({ now: SCENE_MOTION_TIMING.exit, exitStartedAt: 0 }).phase, 'settled');12});1314test('reduced motion resolves to a settled scene without a shutter', () => {15 assert.deepEqual(sceneMotionPhase({ now: 0, openedAt: 500, exitStartedAt: 0, reducedMotion: true }), {16 phase: 'settled', entryProgress: 1, exitProgress: 0, shutterProgress: 0,17 });18});1920test('exit frame keeps its shutter at the shorter D22 beat', () => {21 assert.deepEqual(sceneMotionExitFrame(140, 0), { progress: 0.5, shutterProgress: 1 });22 assert.deepEqual(sceneMotionExitFrame(280, 0), { progress: 1, shutterProgress: 1 });23});24