user_topics: Update 'get_user_topics_for_visibility_policy'.

This prep commit updates the function
'get_user_topics_for_visibility_policy' to include 'visibility_policy'
as one of the keys in the user_topic objects.
This commit is contained in:
Prakhar Pratyush 2023-04-24 19:10:26 +05:30 committed by Tim Abbott
parent 9cad825d95
commit e87f2ff408
3 changed files with 6 additions and 0 deletions

View File

@ -67,6 +67,7 @@ export function get_user_topics_for_visibility_policy(visibility_policy) {
topic,
date_updated,
date_updated_str,
visibility_policy,
});
}
}

View File

@ -36,6 +36,7 @@ run_test("settings", ({override}) => {
stream: frontend.name,
stream_id: frontend.stream_id,
topic: "js",
visibility_policy: user_topics.all_visibility_policies.MUTED,
},
]);
populate_list_called = true;

View File

@ -126,6 +126,7 @@ test("get_mutes", () => {
stream: devel.name,
stream_id: devel.stream_id,
topic: "java",
visibility_policy: all_visibility_policies.MUTED,
},
{
date_updated: 1577836800000,
@ -133,6 +134,7 @@ test("get_mutes", () => {
stream: office.name,
stream_id: office.stream_id,
topic: "gossip",
visibility_policy: all_visibility_policies.MUTED,
},
]);
});
@ -178,6 +180,7 @@ test("set_user_topics", () => {
stream: social.name,
stream_id: social.stream_id,
topic: "breakfast",
visibility_policy: all_visibility_policies.MUTED,
},
{
date_updated: 1577836800000,
@ -185,6 +188,7 @@ test("set_user_topics", () => {
stream: design.name,
stream_id: design.stream_id,
topic: "typography",
visibility_policy: all_visibility_policies.MUTED,
},
],
);