refactor(web): rename keyboard.tests.tsjskeyboard.tests.ts

Test-bot: skip
This commit is contained in:
Eberhard Beilharz 2026-01-26 17:56:28 +01:00
parent bfa6dfa412
commit 84aedb8616
No known key found for this signature in database
GPG key ID: E9140597606020D3
2 changed files with 6 additions and 7 deletions

View file

@ -1257,9 +1257,6 @@ fi
Runs eslint, builds tests, and then runs tests with mocha + c8 (coverage)
**Note:** this is currently hosted in shellHelperFunctions.sh, but will
be moved to builder.typescript.inc.sh in the future.
### Usage
```bash

View file

@ -8,7 +8,7 @@ import { KeyboardHarness, MinimalKeymanGlobal, JSKeyboard } from 'keyman/engine/
import { NodeKeyboardLoader } from '../../../resources/loader/nodeKeyboardLoader.js';
describe('Keyboard tests', function () {
describe('JSKeyboard tests', function () {
const khmerPath = require.resolve('@keymanapp/common-test-resources/keyboards/khmer_angkor.js');
it('accurately determines layout properties', async () => {
@ -16,19 +16,21 @@ describe('Keyboard tests', function () {
const harness = new KeyboardHarness({}, MinimalKeymanGlobal);
const keyboardLoader = new NodeKeyboardLoader(harness);
const keyboard = await keyboardLoader.loadKeyboardFromPath(khmerPath);
const km_keyboard = keyboard as JSKeyboard;
const jsKeyboard = keyboard as JSKeyboard;
// -- END: Standard Recorder-based unit test loading boilerplate --
assert.isFalse(jsKeyboard.isRTL);
// `khmer_angkor` - supports longpresses, but not flicks or multitaps.
// Phone supports longpress if the keyboard supports it.
const mobileLayout = km_keyboard.layout(DeviceSpec.FormFactor.Phone);
const mobileLayout = jsKeyboard.layout(DeviceSpec.FormFactor.Phone);
assert.isTrue(mobileLayout.hasLongpresses);
assert.isFalse(mobileLayout.hasFlicks);
assert.isFalse(mobileLayout.hasMultitaps);
// Desktop doesn't support longpress even if the keyboard supports it.
const desktopLayout = km_keyboard.layout(DeviceSpec.FormFactor.Desktop);
const desktopLayout = jsKeyboard.layout(DeviceSpec.FormFactor.Desktop);
assert.isFalse(desktopLayout.hasLongpresses);
assert.isFalse(desktopLayout.hasFlicks);
assert.isFalse(desktopLayout.hasMultitaps);