From 06c0a9d8aab00d40a8a72b7571ab415a4d162dec Mon Sep 17 00:00:00 2001 From: Avital Oliver Date: Tue, 14 Jan 2014 16:39:54 -0800 Subject: [PATCH] Test that template in DOM before rendered callback fires --- packages/spacebars-tests/template_tests.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/packages/spacebars-tests/template_tests.js b/packages/spacebars-tests/template_tests.js index 706b6a92c5..ec0bd8f157 100644 --- a/packages/spacebars-tests/template_tests.js +++ b/packages/spacebars-tests/template_tests.js @@ -780,6 +780,18 @@ testAsyncMulti('spacebars - template - defer in rendered callbacks', [function ( coll.insert({}); }]); +testAsyncMulti('spacebars - template - rendered template is DOM in rendered callbacks', [ + function (test, expect) { + var tmpl = Template.spacebars_template_test_aaa; + tmpl.rendered = expect(function () { + console.log('in rendered'); + test.equal(trim(stripComments(div.innerHTML)), "aaa"); + }); + var div = renderToDiv(tmpl); + Deps.flush(); + } +]); + // Test that in: // // ```