2017-05-25 01:49:29 +02:00
|
|
|
set_global('$', global.make_zjquery());
|
2017-05-23 01:15:43 +02:00
|
|
|
|
2018-08-01 21:17:03 +02:00
|
|
|
zrequire('common');
|
|
|
|
|
2018-05-15 12:40:07 +02:00
|
|
|
run_test('basics', () => {
|
2017-05-23 01:15:43 +02:00
|
|
|
common.autofocus('#home');
|
2017-05-24 03:41:47 +02:00
|
|
|
assert($('#home').is_focused());
|
2018-05-15 12:40:07 +02:00
|
|
|
});
|
2018-06-25 17:14:45 +02:00
|
|
|
|
|
|
|
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'));
|
|
|
|
});
|