Fix
Template tests / tests (push) Failing after 4m1s

This commit is contained in:
2026-07-07 12:04:08 -05:00
parent a7d398ad6a
commit 9555db9bf5
7 changed files with 163 additions and 22 deletions
+23
View File
@@ -0,0 +1,23 @@
'use strict';
const test = require('node:test');
const assert = require('node:assert/strict');
const {
zoomShortcutFromInputEvent,
zoomShortcutFromKeyboardEvent,
} = require('../../app/shortcut-utils');
test('zoom shortcut helper recognizes zoom in, out, and fit across event shapes', () => {
assert.equal(zoomShortcutFromKeyboardEvent({ ctrlKey: true, key: '=', code: 'Equal' }), 'in');
assert.equal(zoomShortcutFromKeyboardEvent({ ctrlKey: true, key: '+', code: 'NumpadAdd' }), 'in');
assert.equal(zoomShortcutFromKeyboardEvent({ ctrlKey: true, key: '-', code: 'Minus' }), 'out');
assert.equal(zoomShortcutFromKeyboardEvent({ metaKey: true, key: '0', code: 'Digit0' }), 'fit');
assert.equal(zoomShortcutFromKeyboardEvent({ ctrlKey: true, key: '=', code: 'Equal', shiftKey: true }), 'in');
});
test('zoom shortcut helper recognizes Electron before-input-event payloads', () => {
assert.equal(zoomShortcutFromInputEvent({ control: true, key: '=', code: 'Equal' }), 'in');
assert.equal(zoomShortcutFromInputEvent({ control: true, key: '-', code: 'Minus' }), 'out');
assert.equal(zoomShortcutFromInputEvent({ meta: true, key: '0', code: 'Digit0' }), 'fit');
});