diff --git a/frontend_tests/node_tests/topic_generator.js b/frontend_tests/node_tests/topic_generator.js index 6902011bc8..d1af6c18d4 100644 --- a/frontend_tests/node_tests/topic_generator.js +++ b/frontend_tests/node_tests/topic_generator.js @@ -215,19 +215,19 @@ run_test('streams', () => { run_test('topics', () => { const streams = [1, 2, 3, 4]; - const topics = {}; - - topics[1] = ['read', 'read', '1a', '1b', 'read', '1c']; - topics[2] = []; - topics[3] = ['3a', 'read', 'read', '3b', 'read']; - topics[4] = ['4a']; + const topics = new Map([ + [1, ['read', 'read', '1a', '1b', 'read', '1c']], + [2, []], + [3, ['3a', 'read', 'read', '3b', 'read']], + [4, ['4a']], + ]); function has_unread_messages(stream, topic) { return topic !== 'read'; } function get_topics(stream) { - return topics[stream]; + return topics.get(stream); } function next_topic(curr_stream, curr_topic) {