From d93d430516ba5e6c38a01159dc5fafd646516717 Mon Sep 17 00:00:00 2001 From: Sameh Khamis Date: Thu, 19 Nov 2026 13:08:25 -0800 Subject: [PATCH] Test that the Bhote Koshi cinematic button is pressed while it owns the camera The event layer's tests now check the button's pressed state: true once a replay claims the camera, false once the operator releases it. Before, only the panel view's test covered it, with hand-built records. Co-authored-by: Manjunath Paparaju --- src/data/bhoteKoshiEvent.test.mjs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/data/bhoteKoshiEvent.test.mjs b/src/data/bhoteKoshiEvent.test.mjs index d40bd9933f..f149f67bd3 100644 --- a/src/data/bhoteKoshiEvent.test.mjs +++ b/src/data/bhoteKoshiEvent.test.mjs @@ -101,6 +101,7 @@ function eventPanel() { get textContent() { return record().textContent; }, get hidden() { return record().hidden; }, get disabled() { return record().disabled; }, + get pressed() { return record().pressed; }, get value() { return typed ?? record().value; }, set value(value) { typed = value; }, getAttribute: (name) => record().attributes[name] ?? null, @@ -2711,6 +2712,8 @@ test('Bhote Koshi replay restores cinematic ownership unless the operator releas play.dispatch('click'); assert.equal(layer.getCinematicState().active, true); assert.equal(layer.getPlaybackState().progress, 0); + const cinematicControl = panel.querySelector('[data-action="cinematic"]'); + assert.equal(cinematicControl.pressed, true, 'the cinematic button is pressed while it owns the camera'); assert.equal(layer.getPlaybackState().playing, true); assert.equal( body.children.some((element) => element.id === 'bhote-koshi-story-strap'), @@ -2720,6 +2723,7 @@ test('Bhote Koshi replay restores cinematic ownership unless the operator releas panel.querySelector('[data-action="cinematic"]').dispatch('click'); assert.equal(layer.getCinematicState().active, false); assert.equal(viewer._test.cameraTransforms.length, 2); + assert.equal(cinematicControl.pressed, false, 'releasing the camera unpresses the button'); animationCallbacks[1](91001); assert.equal(play.textContent, '↺ REPLAY'); const cameraLookCount = viewer._test.cameraLooks.length;