Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

markdown: Assert we handle timestamps sensibly in push notifications.

Rohitt Vashishtha1a9a478e5d8d
diff --git a/zerver/tests/fixtures/markdown_test_cases.json b/zerver/tests/fixtures/markdown_test_cases.json
index fa42050634f..359748d8da5 100644
--- a/zerver/tests/fixtures/markdown_test_cases.json
+++ b/zerver/tests/fixtures/markdown_test_cases.json
@@ -726,35 +726,41 @@
"name": "timestamp_backend_markdown_only",
"input": "<time:Jun 5th 2017, 10:30PM>",
"expected_output": "<p><time datetime=\"2017-06-05T22:30:00Z\">Jun 5th 2017, 10:30PM</time></p>",
- "marked_expected_output": "<p><span>Jun 5th 2017, 10:30PM</span></p>"
+ "marked_expected_output": "<p><span>Jun 5th 2017, 10:30PM</span></p>",
+ "text_content": "Jun 5th 2017, 10:30PM"
},
{
"name": "timestamp_backend_markdown_and_marked",
"input": "<time:31 Dec 2017>",
- "expected_output": "<p><time datetime=\"2017-12-31T00:00:00Z\">31 Dec 2017</time></p>"
+ "expected_output": "<p><time datetime=\"2017-12-31T00:00:00Z\">31 Dec 2017</time></p>",
+ "text_content": "31 Dec 2017"
},
{
"name": "timestamp_invalid_input",
"input": "<time:<alert(1)>>",
"expected_output": "<p><span class=\"timestamp-error\">Invalid time format: &lt;alert(1)</span>&gt;</p>",
- "marked_expected_output": "<p><span>&lt;alert(1)</span>&gt;</p>"
+ "marked_expected_output": "<p><span>&lt;alert(1)</span>&gt;</p>",
+ "text_content": "Invalid time format: <alert(1)>"
},
{
"name": "timestamp_timezone",
"input": "<time:31 Dec 2017 5:30 am IST>",
"expected_output": "<p><time datetime=\"2017-12-31T00:00:00Z\">31 Dec 2017 5:30 am IST</time></p>",
- "marked_expected_output": "<p><span>31 Dec 2017 5:30 am IST</span></p>"
+ "marked_expected_output": "<p><span>31 Dec 2017 5:30 am IST</span></p>",
+ "text_content": "31 Dec 2017 5:30 am IST"
},
{
"name": "timestamp_incorrect",
"input": "<time:**hello world**>",
"expected_output": "<p><span class=\"timestamp-error\">Invalid time format: **hello world**</span></p>",
- "marked_expected_output": "<p><span>**hello world**</span></p>"
+ "marked_expected_output": "<p><span>**hello world**</span></p>",
+ "text_content": "Invalid time format: **hello world**"
},
{
"name": "timestamp_unix",
- "input": "<time:1496701800>",
- "expected_output": "<p><time datetime=\"2017-06-05T22:30:00Z\">1496701800</time></p>"
+ "input": "Let's meet at <time:1496701800>.",
+ "expected_output": "<p>Let's meet at <time datetime=\"2017-06-05T22:30:00Z\">1496701800</time>.</p>",
+ "text_content": "Let's meet at 1496701800."
},
{
"name": "tex_inline",