feat(stammbaum): mobile read path — pan, zoom, fit-to-view (#692) #694

Merged
marcel merged 39 commits from feat/issue-692-stammbaum-mobile-panzoom into main 2026-05-30 07:43:44 +02:00
Showing only changes of commit 53660eadc9 - Show all commits

View File

@@ -568,12 +568,15 @@ describe('StammbaumTree keyboard pan/zoom (#692)', () => {
const opts = (x: number) => ({ pointerId: 1, clientX: x, clientY: 100, bubbles: true });
svg.dispatchEvent(new PointerEvent('pointerdown', opts(100)));
svg.dispatchEvent(new PointerEvent('pointermove', opts(160)));
svg.dispatchEvent(new PointerEvent('pointerup', opts(160)));
// Assert on the move's emission *before* releasing: inertia starts on
// pointerup and could otherwise perturb the last recorded call.
expect(onPanZoom).toHaveBeenCalled();
// Dragging right reveals content to the left → pan x decreases.
expect(onPanZoom.mock.calls.at(-1)![0].x).toBeLessThan(0);
svg.dispatchEvent(new PointerEvent('pointerup', opts(160)));
// The synthetic click after a real drag must not select the node.
node.dispatchEvent(new MouseEvent('click', { bubbles: true }));
expect(onSelect).not.toHaveBeenCalled();