summaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorYehuda Katz <wycats@gmail.com>2016-09-10 07:10:36 -0700
committerGitHub <noreply@github.com>2016-09-10 07:10:36 -0700
commit7535e48a7969229f44489124a8ef07bd17363f06 (patch)
tree0019d7c0267de63510d2a7b4fe19e349d1b45402 /spec
parent11b99b361d5c76e9f842881b36af9b726494fe85 (diff)
parent21696005cd9e5a3ea2150431df44fd13da2c405c (diff)
downloadhandlebars.js-origin/master.zip
handlebars.js-origin/master.tar.gz
handlebars.js-origin/master.tar.bz2
Merge pull request #1243 from lawnsea/nested-partial-blocksHEADorigin/masterorigin/HEADmaster
Walk up data frames for nested @partial-block
Diffstat (limited to 'spec')
-rw-r--r--spec/partials.js23
1 files changed, 23 insertions, 0 deletions
diff --git a/spec/partials.js b/spec/partials.js
index d3ead74..d6baba5 100644
--- a/spec/partials.js
+++ b/spec/partials.js
@@ -270,6 +270,20 @@ describe('partials', function() {
true,
'success');
});
+ it('should render nested partial blocks', function() {
+ shouldCompileToWithPartials(
+ '<template>{{#> outer}}{{value}}{{/outer}}</template>',
+ [
+ {value: 'success'},
+ {},
+ {
+ outer: '<outer>{{#> nested}}<outer-block>{{> @partial-block}}</outer-block>{{/nested}}</outer>',
+ nested: '<nested>{{> @partial-block}}</nested>'
+ }
+ ],
+ true,
+ '<template><outer><nested><outer-block>success</outer-block></nested></outer></template>');
+ });
});
describe('inline partials', function() {
@@ -309,6 +323,15 @@ describe('partials', function() {
true,
'success');
});
+ it('should render nested inline partials', function() {
+ shouldCompileToWithPartials(
+ '{{#*inline "outer"}}{{#>inner}}<outer-block>{{>@partial-block}}</outer-block>{{/inner}}{{/inline}}' +
+ '{{#*inline "inner"}}<inner>{{>@partial-block}}</inner>{{/inline}}' +
+ '{{#>outer}}{{value}}{{/outer}}',
+ [{value: 'success'}, {}, {}],
+ true,
+ '<inner><outer-block>success</outer-block></inner>');
+ });
});
it('should pass compiler flags', function() {