Navigation Menu

Skip to content

Commit

Permalink
Adding tests for #1013
Browse files Browse the repository at this point in the history
  • Loading branch information
daffl committed Nov 3, 2014
1 parent ffc6c7b commit 69e0734
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
11 changes: 11 additions & 0 deletions view/mustache/mustache_test.js
Expand Up @@ -3850,4 +3850,15 @@ steal("can/model", "can/view/mustache", "can/test", "can/view/mustache/spec/spec
var frag = can.mustache(tmpl)({ noData: true });
equal(frag.childNodes[0].innerHTML, 'no data', 'else with unless worked');
});

test("<col> inside <table> renders correctly (#1013)", 1, function() {
var expected = '<table><colgroup><col class="test"></colgroup><tbody></tbody></table>';
var template = '<table><colgroup>{{#columns}}<col class="{{class}}" />{{/columns}}</colgroup><tbody></tbody></table>';
var frag = can.mustache(template)({
columns: new can.List([ { class: 'test' } ])
});

console.log(frag.childNodes)
equal(frag.childNodes[1].outerHTML, expected, '<col> nodes added in proper position');
});
});
10 changes: 10 additions & 0 deletions view/stache/stache_test.js
Expand Up @@ -3617,4 +3617,14 @@ steal("can/view/stache", "can/view","can/test","can/view/mustache/spec/specs",fu
equal(frag.childNodes[0].innerHTML, "ARS", "got value");

});

test("<col> inside <table> renders correctly (#1013)", 1, function() {
var expected = '<table><colgroup><col style="width: 100px;"></colgroup><tbody></tbody></table>';
var template = '<table><colgroup>{{#columns}}<col style="width: {{width}}px;" />{{/columns}}</colgroup><tbody></tbody></table>';
var frag = can.stache(template)({
columns: new can.List([ { width: 100 } ])
});

equal(frag.childNodes[0].outerHTML, expected, '<col> nodes added in proper position');
});
});

0 comments on commit 69e0734

Please sign in to comment.