mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 21:43:21 +00:00
This run_test helper sets up a convention that allows us to give really short tracebacks for errors, and eventually we can have more control over running individual tests. (The latter goal has some complications, since we often intentionally leak setup in tests.)
15 lines
365 B
JavaScript
15 lines
365 B
JavaScript
set_global('$', global.make_zjquery());
|
|
zrequire('buddy_list');
|
|
|
|
run_test('get_items', () => {
|
|
const alice_li = $.create('alice stub');
|
|
const sel = 'li.user_sidebar_entry';
|
|
|
|
buddy_list.container.set_find_results(sel, {
|
|
map: (f) => [f(0, alice_li)],
|
|
});
|
|
const items = buddy_list.get_items();
|
|
|
|
assert.deepEqual(items, [alice_li]);
|
|
});
|