From 5827d960ac98d5d322f792d03c485c83dd698491 Mon Sep 17 00:00:00 2001
From: Shane Tomlinson <stomlinson@mozilla.com>
Date: Mon, 17 Sep 2012 11:32:25 +0100
Subject: [PATCH] Add unit tests checking for partial support on the client.

---
 .../dialog/views/test_template_with_partial.ejs    |  6 ++++++
 resources/static/test/cases/common/js/renderer.js  | 14 ++++++++------
 2 files changed, 14 insertions(+), 6 deletions(-)
 create mode 100644 resources/static/dialog/views/test_template_with_partial.ejs

diff --git a/resources/static/dialog/views/test_template_with_partial.ejs b/resources/static/dialog/views/test_template_with_partial.ejs
new file mode 100644
index 000000000..11c1a6c41
--- /dev/null
+++ b/resources/static/dialog/views/test_template_with_partial.ejs
@@ -0,0 +1,6 @@
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+   - License, v. 2.0. If a copy of the MPL was not distributed with this
+   - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
+
+<%- partial('test_template_no_input') %>
+
diff --git a/resources/static/test/cases/common/js/renderer.js b/resources/static/test/cases/common/js/renderer.js
index 2c3b8f116..9932204f5 100644
--- a/resources/static/test/cases/common/js/renderer.js
+++ b/resources/static/test/cases/common/js/renderer.js
@@ -20,12 +20,6 @@
     }
   });
 
-  test("render template loaded using XHR", function() {
-    renderer.render("#formWrap .contents", "test_template_with_input");
-
-    ok($("#templateInput").length, "template written when loaded using XHR");
-  });
-
   test("render template from memory", function() {
     renderer.render("#formWrap .contents", "inMemoryTemplate");
 
@@ -39,6 +33,14 @@
 
   });
 
+  test("render template with partial", function() {
+    equal($("#focusButton").length, 0, "template not yet loaded");
+
+    renderer.render("#formWrap .contents", "test_template_with_partial");
+
+    ok($("#focusButton").length, "template loaded with partial");
+  });
+
 }());
 
 
-- 
GitLab