zulip/frontend_tests/node_tests/common.js

19 lines
502 B
JavaScript
Raw Normal View History

2017-11-08 20:28:46 +01:00
zrequire('common');
2017-05-25 01:49:29 +02:00
set_global('$', global.make_zjquery());
run_test('basics', () => {
common.autofocus('#home');
assert($('#home').is_focused());
});
run_test('phrase_match', () => {
assert(common.phrase_match('tes', 'test'));
assert(common.phrase_match('Tes', 'test'));
assert(common.phrase_match('Tes', 'Test'));
assert(common.phrase_match('tes', 'Stream Test'));
assert(!common.phrase_match('tests', 'test'));
assert(!common.phrase_match('tes', 'hostess'));
});