mirror of
https://github.com/zulip/zulip.git
synced 2025-11-01 04:23:46 +00:00
tests: Reach 100% coverage for keydown_util.
This commit pretty much just gets line coverage.
This commit is contained in:
26
frontend_tests/node_tests/keydown_util.js
Normal file
26
frontend_tests/node_tests/keydown_util.js
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
set_global('$', global.make_zjquery());
|
||||||
|
|
||||||
|
zrequire('keydown_util');
|
||||||
|
|
||||||
|
run_test('test_early_returns', () => {
|
||||||
|
var stub = $.create('stub');
|
||||||
|
var opts = {
|
||||||
|
elem: stub,
|
||||||
|
handlers: {},
|
||||||
|
};
|
||||||
|
|
||||||
|
keydown_util.handle(opts);
|
||||||
|
var keydown_f = stub.keydown;
|
||||||
|
|
||||||
|
var e1 = {
|
||||||
|
which: 17, // not in keys
|
||||||
|
};
|
||||||
|
|
||||||
|
keydown_f(e1);
|
||||||
|
|
||||||
|
var e2 = {
|
||||||
|
which: 13, // no handler
|
||||||
|
};
|
||||||
|
|
||||||
|
keydown_f(e2);
|
||||||
|
});
|
||||||
@@ -43,6 +43,7 @@ enforce_fully_covered = {
|
|||||||
'static/js/fetch_status.js',
|
'static/js/fetch_status.js',
|
||||||
'static/js/filter.js',
|
'static/js/filter.js',
|
||||||
'static/js/hash_util.js',
|
'static/js/hash_util.js',
|
||||||
|
'static/js/keydown_util.js',
|
||||||
'static/js/markdown.js',
|
'static/js/markdown.js',
|
||||||
'static/js/message_store.js',
|
'static/js/message_store.js',
|
||||||
'static/js/muting.js',
|
'static/js/muting.js',
|
||||||
|
|||||||
Reference in New Issue
Block a user