Skip to content

Commit

Permalink
test for content within partial displaying outside partial (#2186)
Browse files Browse the repository at this point in the history
  • Loading branch information
phillipskevin committed Jan 14, 2016
1 parent bc38756 commit bf4c118
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion view/stache/stache_test.js
Expand Up @@ -4689,7 +4689,22 @@ steal("can-simple-dom", "can/util/vdom/build_fragment","can/view/stache", "can/v
data.attr('items.0.name', 'dave');

equal(frag.firstChild.nextSibling.getAttribute('value'), 'user text');
});
});


test("content within {{#if}} inside partial surrounded by {{#if}} should not display outside partial (#2186)", function() {
can.view.registerView('partial', '{{#if showHiddenSection}}<div>Hidden</div>{{/if}}');
var renderer = can.stache('{{#if showPartial}}{{>partial}}{{/if}}');
var data = new can.Map({
showPartial: true,
showHiddenSection: false
});
var frag = renderer(data);
data.attr('showHiddenSection', true);
data.attr('showPartial', false);

equal( innerHTML(frag), '');
});

// PUT NEW TESTS RIGHT BEFORE THIS!
}
Expand Down

0 comments on commit bf4c118

Please sign in to comment.