mirror of https://github.com/zulip/zulip.git
tests: Convert topics from object to Map.
Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
This commit is contained in:
parent
68ddfec78c
commit
5daf6f274f
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue