buddy list: Simplify argument to get_data_from_keys.

This commit is contained in:
evykassirer
2023-09-26 23:40:13 -07:00
committed by Tim Abbott
parent 14b7d097a0
commit 5c77244fb0
2 changed files with 3 additions and 7 deletions

View File

@@ -35,8 +35,7 @@ class BuddyListConf {
return Number.parseInt(opts.$li.expectOne().attr("data-user-id"), 10);
}
get_data_from_keys(opts) {
const keys = opts.keys;
get_data_from_keys(keys) {
const data = buddy_data.get_items_for_users(keys);
return data;
}
@@ -80,9 +79,7 @@ export class BuddyList extends BuddyListConf {
return;
}
const items = this.get_data_from_keys({
keys: more_keys,
});
const items = this.get_data_from_keys(more_keys);
const html = this.items_to_html({
items,

View File

@@ -57,8 +57,7 @@ run_test("basics", ({override}) => {
const buddy_list = new BuddyList();
init_simulated_scrolling();
override(buddy_list, "get_data_from_keys", (opts) => {
const keys = opts.keys;
override(buddy_list, "get_data_from_keys", (keys) => {
assert.deepEqual(keys, [alice.user_id]);
return "data-stub";
});