From eee8ff40b41ec4e62da69792ff76cfc3582269c6 Mon Sep 17 00:00:00 2001 From: Steve Howell Date: Sun, 16 May 2021 15:24:11 +0000 Subject: [PATCH] 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. --- frontend_tests/node_tests/buddy_data.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/frontend_tests/node_tests/buddy_data.js b/frontend_tests/node_tests/buddy_data.js index d17cdb16c4..8698ae1d52 100644 --- a/frontend_tests/node_tests/buddy_data.js +++ b/frontend_tests/node_tests/buddy_data.js @@ -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", () => {