aboutsummaryrefslogtreecommitdiffstats
path: root/test/testabilityPatch.js
diff options
context:
space:
mode:
authorMisko Hevery2010-10-26 22:02:24 -0700
committerMisko Hevery2010-10-27 15:42:46 -0700
commit62c0e5c46091d8b98a20c31ab26e715bad574bae (patch)
tree18e73b82cb9017b9e9b66d3ec094c53ce0b633a8 /test/testabilityPatch.js
parentc67af8a03819004c4aaa775805badd1e631af738 (diff)
downloadangular.js-62c0e5c46091d8b98a20c31ab26e715bad574bae.tar.bz2
Fix failing tests for ie, and mark elements as ng-widget, ng-directive, and ng-binding
Diffstat (limited to 'test/testabilityPatch.js')
-rw-r--r--test/testabilityPatch.js12
1 files changed, 9 insertions, 3 deletions
diff --git a/test/testabilityPatch.js b/test/testabilityPatch.js
index 5c6eaf4d..e8041ac7 100644
--- a/test/testabilityPatch.js
+++ b/test/testabilityPatch.js
@@ -81,7 +81,7 @@ extend(angular, {
});
-function sortedHtml(element) {
+function sortedHtml(element, showNgClass) {
var html = "";
foreach(jqLite(element), function toString(node) {
if (node.nodeName == "#text") {
@@ -93,8 +93,14 @@ function sortedHtml(element) {
html += '<' + node.nodeName.toLowerCase();
var attributes = node.attributes || [];
var attrs = [];
- if (node.className)
- attrs.push(' class="' + node.className + '"');
+ var className = node.className || '';
+ if (!showNgClass) {
+ className = className.replace(/ng-[\w-]+\s*/g, '');
+ }
+ className = trim(className);
+ if (className) {
+ attrs.push(' class="' + className + '"');
+ }
for(var i=0; i<attributes.length; i++) {
var attr = attributes[i];
if(attr.name.match(/^ng:/) ||