Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
widgets: Add test for tokenizing widget type on newline.
N-Shar-ma89739ba3c3d7
diff --git a/zerver/tests/test_widgets.py b/zerver/tests/test_widgets.pyindex 7bbca54ce6e..ef43cabfc5f 100644--- a/zerver/tests/test_widgets.py+++ b/zerver/tests/test_widgets.py@@ -97,8 +97,11 @@ class WidgetContentTestCase(ZulipTestCase):for message in test_messages:self.assertEqual(get_widget_data(content=message), (None, None))- # Add a positive check for context+ # Add positive checks for contextself.assertEqual(get_widget_data(content="/todo"), ("todo", None))+ self.assertEqual(get_widget_data(content="/todo ignore"), ("todo", None))+ # Test tokenization on newline character+ self.assertEqual(get_widget_data(content="/todo\nignore"), ("todo", None))def test_explicit_widget_content(self) -> None:# Users can send widget_content directly on messages