mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
add body attributes tests
This commit is contained in:
committed by
Sashko Stubailo
parent
48ecdf1d54
commit
fa4e9c676e
@@ -172,7 +172,7 @@ html_scanner = {
|
||||
} else {
|
||||
// <body>
|
||||
if (hasAttribs) {
|
||||
for(var attr in attribs) {p
|
||||
for(var attr in attribs) {
|
||||
if (this.bodyAttributes.indexOf(attr) !== -1) {
|
||||
console.log('WARNING: tag ' + attr + ' already defined on body.');
|
||||
}
|
||||
|
||||
@@ -112,6 +112,9 @@ Tinytest.add("templating - html scanner", function (test) {
|
||||
'pizza</template>'),
|
||||
simpleTemplate('"the \\"cool\\" template"', '"pizza"'));
|
||||
|
||||
checkResults(html_scanner.scan('<body foo="bar">\n Hello\n</body>'),
|
||||
"\nMeteor.startup(function() { $('body').attr({\"foo\":\"bar\"}); });\n" + simpleBody('"Hello"'));
|
||||
|
||||
// error cases; exact line numbers are not critical, these just reflect
|
||||
// the current implementation
|
||||
|
||||
@@ -153,11 +156,6 @@ Tinytest.add("templating - html scanner", function (test) {
|
||||
'<!doctype html>');
|
||||
}, "DOCTYPE", 1);
|
||||
|
||||
// attributes on body not supported
|
||||
checkError(function() {
|
||||
return html_scanner.scan('<body foo="bar">\n Hello\n</body>');
|
||||
}, "<body>", 1);
|
||||
|
||||
// attributes on head not supported
|
||||
checkError(function() {
|
||||
return html_scanner.scan('<head foo="bar">\n Hello\n</head>');
|
||||
|
||||
Reference in New Issue
Block a user