From 86b33eb3f1360a4cefb5ebf522b6649f9c55db55 Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Tue, 4 Dec 2012 18:24:15 +0100 Subject: test(sortedHtml): fix comment support in sortedHtml helper --- test/testabilityPatch.js | 3 +++ 1 file changed, 3 insertions(+) (limited to 'test/testabilityPatch.js') diff --git a/test/testabilityPatch.js b/test/testabilityPatch.js index 679294ee..732669c5 100644 --- a/test/testabilityPatch.js +++ b/test/testabilityPatch.js @@ -120,11 +120,14 @@ function dealoc(obj) { function sortedHtml(element, showNgClass) { var html = ""; forEach(jqLite(element), function toString(node) { + if (node.nodeName == "#text") { html += node.nodeValue. replace(/&(\w+[&;\W])?/g, function(match, entity){return entity?match:'&';}). replace(//g, '>'); + } else if (node.nodeName == "#comment") { + html += ''; } else { html += '<' + (node.nodeName || '?NOT_A_NODE?').toLowerCase(); var attributes = node.attributes || []; -- cgit v1.2.3