Permalink
Browse files

adds a test for makeElement behaviour, exposes it globally for testin…

…g purposes, this test case would throw in earlier versions
  • Loading branch information...
1 parent 741a55e commit cdf6a9538d35c45c06fe46346534865e5382d13b @noahadams noahadams committed Mar 5, 2013
Showing with 9 additions and 1 deletion.
  1. +2 −1 api/extractDOM.js
  2. +7 −0 tests/index.html
View
3 api/extractDOM.js
@@ -106,7 +106,8 @@ $.extend(html, {
Mobify.timing.addPoint('Built Passive DOM');
return result;
- }
+ },
+ makeElement: makeElement
});
})(Mobify.$, Mobify);
View
7 tests/index.html
@@ -571,6 +571,13 @@ <h2 id="qunit-userAgent"></h2>
equal(got, vow);
});
+ test('Mobify.html.makeElement fails on bad body tag', function() {
+ var got = Mobify.html.makeElement('<bodyclass="foo bar">')
+ , vow = document.createElement("bodyclass");
+
+ deepEqual(got, vow, "makeElement fails to get attributes of badly formed 'bodyclass' element");
+ });
+
module('Mobify.urlmatch');
// First, some utility functions and variables
var locationify, urlmatch, testUrlMatch;

0 comments on commit cdf6a95

Please sign in to comment.