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.

template.js: Add test for "or" helper.

YashRE422e910842d8ae
diff --git a/frontend_tests/node_tests/templates.js b/frontend_tests/node_tests/templates.js
index d39668be467..6a6f48efca2 100644
--- a/frontend_tests/node_tests/templates.js
+++ b/frontend_tests/node_tests/templates.js
@@ -15,3 +15,12 @@ run_test("and", () => {
const html = require("./templates/and.hbs")(args);
assert.equal(html, "<p>empty and</p>\n<p>last and</p>\n\n");
});
+
+run_test("or", () => {
+ const args = {
+ last: true,
+ };
+
+ const html = require("./templates/or.hbs")(args);
+ assert.equal(html, "\n<p>last or</p>\n<p>true or</p>\n");
+});
diff --git a/frontend_tests/node_tests/templates/or.hbs b/frontend_tests/node_tests/templates/or.hbs
new file mode 100644
index 00000000000..d74e769af20
--- /dev/null
+++ b/frontend_tests/node_tests/templates/or.hbs
@@ -0,0 +1,3 @@
+{{#if (or)}}<p>empty or</p>{{/if}}
+{{#if (or false last)}}<p>last or</p>{{/if}}
+{{#if (or true false)}}<p>true or</p>{{/if}}