tests: Reach 100% coverage for keydown_util.

This commit pretty much just gets line coverage.
This commit is contained in:
Joshua Pan 2018-07-22 15:45:46 -07:00 committed by showell
parent 5f4895f780
commit 015bc8b01e
2 changed files with 27 additions and 0 deletions

View 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);
});

View File

@ -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',