Rename `doNotPrevent` option to `preventDefault`.
Release-Notes: skip
Change-Id: Ibb6de9305f6724dbf73dbd0be7d4c354724bbce2
diff --git a/polygerrit-ui/app/services/shortcuts/shortcuts-service_test.ts b/polygerrit-ui/app/services/shortcuts/shortcuts-service_test.ts
index 35da84e..9f0a34f 100644
--- a/polygerrit-ui/app/services/shortcuts/shortcuts-service_test.ts
+++ b/polygerrit-ui/app/services/shortcuts/shortcuts-service_test.ts
@@ -48,31 +48,32 @@
test('standard call', () => {
service.addShortcut(el, KEY_A, listener);
+ assert.isTrue(listener.notCalled);
pressKey(el, KEY_A.key);
assert.isTrue(listener.calledOnce);
});
- test('doNotPrevent option default false', () => {
+ test('preventDefault option default false', () => {
service.addShortcut(el, KEY_A, listener);
pressKey(el, KEY_A.key);
assert.isTrue(listener.calledOnce);
assert.isTrue(listener.lastCall.firstArg?.defaultPrevented);
});
- test('doNotPrevent option force false', () => {
- service.addShortcut(el, KEY_A, listener, {doNotPrevent: false});
- pressKey(el, KEY_A.key);
- assert.isTrue(listener.calledOnce);
- assert.isTrue(listener.lastCall.firstArg?.defaultPrevented);
- });
-
- test('doNotPrevent option force true', () => {
- service.addShortcut(el, KEY_A, listener, {doNotPrevent: true});
+ test('preventDefault option force false', () => {
+ service.addShortcut(el, KEY_A, listener, {preventDefault: false});
pressKey(el, KEY_A.key);
assert.isTrue(listener.calledOnce);
assert.isFalse(listener.lastCall.firstArg?.defaultPrevented);
});
+ test('preventDefault option force true', () => {
+ service.addShortcut(el, KEY_A, listener, {preventDefault: true});
+ pressKey(el, KEY_A.key);
+ assert.isTrue(listener.calledOnce);
+ assert.isTrue(listener.lastCall.firstArg?.defaultPrevented);
+ });
+
test('shouldSuppress option default true', () => {
service.shortcutsDisabled = true;
service.addShortcut(el, KEY_A, listener);