node tests: Fix false positive for muted user.

The test was passing here because we didn't add
selma. We want to make sure it's due to the actual
muting.
This commit is contained in:
Steve Howell 2021-05-16 15:24:11 +00:00 committed by Steve Howell
parent 9825be339b
commit eee8ff40b4
1 changed files with 5 additions and 0 deletions

View File

@ -387,14 +387,19 @@ test("simple search", () => {
});
test("muted users excluded from search", () => {
people.add_active_user(selma);
muting.add_muted_user(selma.user_id);
let user_ids = buddy_data.get_filtered_and_sorted_user_ids();
assert.equal(user_ids.includes(selma.user_id), false);
user_ids = buddy_data.get_filtered_and_sorted_user_ids("sel");
assert.deepEqual(user_ids, []);
assert(!buddy_data.matches_filter("sel", selma.user_id));
muting.remove_muted_user(selma.user_id);
user_ids = buddy_data.get_filtered_and_sorted_user_ids("sel");
assert.deepEqual(user_ids, [selma.user_id]);
assert(buddy_data.matches_filter("sel", selma.user_id));
});
test("bulk_data_hacks", () => {