From 611f44b339e15f68f13477bb5c5ccdd91ea04990 Mon Sep 17 00:00:00 2001 From: Steve Howell Date: Mon, 24 Jul 2017 08:09:15 -0400 Subject: [PATCH] node tests: Test topic casing for unread counts. We use multiple casings of "lunch" as a topic in our tests, so that we verify that unread counts respect that topics are not case sensitive. We also eliminate an obsolete stub. --- frontend_tests/node_tests/unread.js | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/frontend_tests/node_tests/unread.js b/frontend_tests/node_tests/unread.js index e6a0003f7f..c1a2927097 100644 --- a/frontend_tests/node_tests/unread.js +++ b/frontend_tests/node_tests/unread.js @@ -15,9 +15,6 @@ add_dependencies({ var stream_data = require('js/stream_data.js'); -stream_data = { - canonicalized_name: stream_data.canonicalized_name, -}; set_global('stream_data', stream_data); set_global('blueslip', {}); @@ -91,19 +88,19 @@ var zero_counts = { id: 15, type: 'stream', stream_id: stream_id, - subject: 'lunch', + subject: 'luNch', }; var other_message = { id: 16, type: 'stream', stream_id: stream_id, - subject: 'lunch', + subject: 'lunCH', }; unread.process_loaded_messages([message, other_message]); - count = unread.num_unread_for_subject(stream_id, 'lunch'); + count = unread.num_unread_for_subject(stream_id, 'Lunch'); assert.equal(count, 2); assert(unread.topic_has_any_unread(stream_id, 'lunch')); assert(!unread.topic_has_any_unread(wrong_stream_id, 'lunch')); @@ -114,7 +111,7 @@ var zero_counts = { unread.update_unread_topics(message, event); - count = unread.num_unread_for_subject(stream_id, 'lunch'); + count = unread.num_unread_for_subject(stream_id, 'lUnch'); assert.equal(count, 1); count = unread.num_unread_for_subject(stream_id, 'dinner');