Files
zulip/frontend_tests/node_tests/buddy_list.js
Steve Howell 5cdce82f7c refactor: Add compare_function to buddy_list.
We were passing this in before, but having it as
a data member reinforces the idea that we'll want
this to be a first-class concept in the list, since
we depend on ordering for various things.
2018-07-25 15:53:27 -07:00

16 lines
389 B
JavaScript

set_global('$', global.make_zjquery());
zrequire('buddy_data');
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]);
});