aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorIgor Minar2013-02-25 20:43:27 -0800
committerIgor Minar2013-02-25 21:45:39 -0800
commite281413919db26dbb0cc1d4b892d22fd0475fb68 (patch)
treef8be06d32ca4c1a75473de217358e781fdc95d61 /test
parent2007ddd3f80d212934783a6ad8167db72a4bd6dd (diff)
downloadangular.js-e281413919db26dbb0cc1d4b892d22fd0475fb68.tar.bz2
chore(sortedHtml): print attributes with empty value
I had to also fix some tests as they started failing on IE8. We should figure out why these extra attributes are set in IE8, but I'm too tired of IE to worry about it now. Since I'm not introducing this issue just making it visible, I'm going to commit this as is.
Diffstat (limited to 'test')
-rw-r--r--test/ng/compileSpec.js28
-rw-r--r--test/testabilityPatch.js2
2 files changed, 19 insertions, 11 deletions
diff --git a/test/ng/compileSpec.js b/test/ng/compileSpec.js
index ddcd8270..163eefba 100644
--- a/test/ng/compileSpec.js
+++ b/test/ng/compileSpec.js
@@ -741,12 +741,16 @@ describe('$compile', function() {
$rootScope.$digest();
- expect(sortedHtml(element)).
- toEqual('<div><b class="i-hello"></b><span class="i-cau">Cau!</span></div>');
+ expect(sortedHtml(element)).toBeOneOf(
+ '<div><b class="i-hello"></b><span class="i-cau">Cau!</span></div>',
+ '<div><b class="i-hello"></b><span class="i-cau" i-cau="">Cau!</span></div>' //ie8
+ );
$httpBackend.flush();
- expect(sortedHtml(element)).
- toEqual('<div><span class="i-hello">Hello!</span><span class="i-cau">Cau!</span></div>');
+ expect(sortedHtml(element)).toBeOneOf(
+ '<div><span class="i-hello">Hello!</span><span class="i-cau">Cau!</span></div>',
+ '<div><span class="i-hello" i-hello="">Hello!</span><span class="i-cau" i-cau="">Cau!</span></div>' //ie8
+ );
}
));
@@ -773,8 +777,10 @@ describe('$compile', function() {
$rootScope.$digest();
- expect(sortedHtml(element)).
- toEqual('<div><span class="i-hello">Hello, Elvis!</span></div>');
+ expect(sortedHtml(element)).toBeOneOf(
+ '<div><span class="i-hello">Hello, Elvis!</span></div>',
+ '<div><span class="i-hello" i-hello="">Hello, Elvis!</span></div>' //ie8
+ );
}
));
@@ -803,8 +809,10 @@ describe('$compile', function() {
element = template($rootScope);
$rootScope.$digest();
- expect(sortedHtml(element)).
- toEqual('<div><span class="i-hello">Hello, Elvis!</span></div>');
+ expect(sortedHtml(element)).toBeOneOf(
+ '<div><span class="i-hello">Hello, Elvis!</span></div>',
+ '<div><span class="i-hello" i-hello="">Hello, Elvis!</span></div>' //ie8
+ );
}
));
@@ -1490,13 +1498,13 @@ describe('$compile', function() {
$rootScope.$digest();
expect(sortedHtml(element).replace(' selected="true"', '')).
toEqual('<select ng:model="x">' +
- '<option>Greet !</option>' +
+ '<option value="">Greet !</option>' +
'</select>');
$rootScope.name = 'Misko';
$rootScope.$digest();
expect(sortedHtml(element).replace(' selected="true"', '')).
toEqual('<select ng:model="x">' +
- '<option>Greet Misko!</option>' +
+ '<option value="">Greet Misko!</option>' +
'</select>');
}));
diff --git a/test/testabilityPatch.js b/test/testabilityPatch.js
index d55ff015..cef00993 100644
--- a/test/testabilityPatch.js
+++ b/test/testabilityPatch.js
@@ -114,7 +114,7 @@ function sortedHtml(element, showNgClass) {
var attr = attributes[i];
if(attr.name.match(/^ng[\:\-]/) ||
- attr.value &&
+ (attr.value || attr.value == '') &&
attr.value !='null' &&
attr.value !='auto' &&
attr.value !='false' &&