aboutsummaryrefslogtreecommitdiffstats
path: root/test/directive/inputSpec.js
diff options
context:
space:
mode:
authorMisko Hevery2012-03-19 12:20:57 -0700
committerMisko Hevery2012-03-19 15:49:42 -0700
commit1cc0e4173de01d6c4103910d231a24b2834f4d91 (patch)
tree076fcf51827a4dc8161959de8944a72dff4d0bcf /test/directive/inputSpec.js
parentd4ae7988dad88af608db9cf34992c9c748eda6aa (diff)
downloadangular.js-1cc0e4173de01d6c4103910d231a24b2834f4d91.tar.bz2
bug(ie7): incorrectly set all inputs to disabled
In ie7 all of the input fields are set to readonly and disabled, because ie7 enumerates over all attributes even if the are not declared on the element.
Diffstat (limited to 'test/directive/inputSpec.js')
-rw-r--r--test/directive/inputSpec.js23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/directive/inputSpec.js b/test/directive/inputSpec.js
index 2a7244c9..22c77f53 100644
--- a/test/directive/inputSpec.js
+++ b/test/directive/inputSpec.js
@@ -316,6 +316,29 @@ describe('input', function() {
});
+ it('should not set readonly or disabled property on ie7', function() {
+ this.addMatchers({
+ toBeOff: function(attributeName) {
+ var actualValue = this.actual.attr(attributeName);
+ this.message = function() {
+ return "Attribute '" + attributeName + "' expected to be off but was '" + actualValue +
+ "' in: " + angular.mock.dump(this.actual);
+ }
+
+ return !actualValue || actualValue == 'false';
+ }
+ });
+
+ compileInput('<input type="text" ng-model="name" name="alias"/>');
+ expect(inputElm.prop('readOnly')).toBe(false);
+ expect(inputElm.prop('disabled')).toBe(false);
+
+ expect(inputElm).toBeOff('readOnly');
+ expect(inputElm).toBeOff('readonly');
+ expect(inputElm).toBeOff('disabled');
+ });
+
+
it('should cleanup it self from the parent form', function() {
compileInput('<input ng-model="name" name="alias" required>');