Wrap HTML elements in $ so matchers still work

Esse commit está contido em:
Kevin Sawicki
2014-09-10 11:19:02 -07:00
commit c141448e9f
+3
Ver Arquivo
@@ -138,6 +138,9 @@ jasmine.JQuery.matchersClass = {};
var builtInMatcher = jasmine.Matchers.prototype[methodName];
jasmine.JQuery.matchersClass[methodName] = function() {
if (this.actual instanceof HTMLElement) {
this.actual = jQuery(this.actual);
}
if (this.actual instanceof jQuery) {
var result = jQueryMatchers[methodName].apply(this, arguments);
this.actual = jasmine.JQuery.elementToString(this.actual);