working on jQuery passing tests

This commit is contained in:
Misko Hevery 2010-04-22 15:50:20 -07:00
parent d7416c4c82
commit 2a9669e1d8
6 changed files with 21 additions and 9 deletions

View file

@ -3,9 +3,7 @@ server: http://localhost:9876
load:
- lib/jasmine/jasmine-0.10.3.js
- lib/jasmine-jstd-adapter/JasmineAdapter.js
# - lib/webtoolkit/webtoolkit.base64.js
# - lib/jquery/jquery-1.4.2.js
# - lib/underscore/underscore.js
- lib/jquery/jquery-1.4.2.js
- src/Angular.js
- src/*.js
- src/scenario/_namespace.js

View file

@ -112,9 +112,7 @@ function lowercase(value){ return isString(value) ? value.toLowerCase() : value;
function uppercase(value){ return isString(value) ? value.toUpperCase() : value; }
function trim(value) { return isString(value) ? value.replace(/^\s*/, '').replace(/\s*$/, '') : value; }
function isElement(node) {
if (node && !node.item && isDefined(node.length) && isDefined(node[0]))
node = node[0];
return node && node.nodeName;
return node && (node.nodeName || node instanceof JQLite || node instanceof jQuery);
}
if (msie) {

View file

@ -269,7 +269,9 @@ foreach({
},
'html': function(html){
return jqLite(html);
var div = jqLite('div');
div.html(html);
return div.children();
},
'linky': function(text){

View file

@ -118,6 +118,10 @@ JQLite.prototype = {
this[0].parentNode.replaceChild(jqLite(replaceNode)[0], this[0]);
},
children: function() {
return new JQLite(this[0].childNodes);
},
append: function(node) {
var self = this[0];
node = jqLite(node);

View file

@ -103,7 +103,7 @@ angularService("$hover", function(browser) {
width: width + "px"
});
}
} else if (tooltip) {
} else if (tooltip && false) {
tooltip.callout.remove();
tooltip = null;
}

View file

@ -1,7 +1,11 @@
jstd = jstestdriver;
dump = bind(jstd.console, jstd.console.log);
var NBSP = jqLite(' ').text();
var NBSP = (function(){
var div = document.createElement('div');
div.innerHtml = ' ';
return msie ? div.innerText : div.textContent;
})();
function nakedExpect(obj) {
return expect(angular.fromJson(angular.toJson(obj)));
@ -82,6 +86,12 @@ function sortedHtml(element) {
}
}
style.sort();
var tmp = style;
style = [];
foreach(tmp, function(value){
if (!value.match(/^max[^\-]/))
style.push(value);
});
if (style.length) {
html += ' style="' + style.join('; ') + ';"';
}