mirror of
https://github.com/keymanapp/keyman.git
synced 2026-08-05 00:15:32 +00:00
refactor(web): rename keyboard.tests.ts → jskeyboard.tests.ts
Test-bot: skip
This commit is contained in:
parent
bfa6dfa412
commit
84aedb8616
2 changed files with 6 additions and 7 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
Loading…
Add table
Reference in a new issue