|
4 | 4 | generateInputCompilerHelper: false,
|
5 | 5 | $defaultModelOptions: false
|
6 | 6 | */
|
7 |
| -describe('ngModelOptions', function() { |
| 7 | +fdescribe('ngModelOptions', function() { |
8 | 8 |
|
9 | 9 | describe('$defaultModelOptions', function() {
|
10 | 10 | it('should provide default values', function() {
|
@@ -180,6 +180,31 @@ describe('ngModelOptions', function() {
|
180 | 180 | });
|
181 | 181 |
|
182 | 182 |
|
| 183 | + it('should `updateOnDefault` as well if we have `updateOn: "$inherit"`', function() { |
| 184 | + var container = $compile( |
| 185 | + '<div ng-model-options="{updateOn: \'keyup\'}">' + |
| 186 | + '<input ng-model-options="{\'updateOn\': \'$inherit\'}">' + |
| 187 | + '<div ng-model-options="{updateOn: \'default blur\'}">' + |
| 188 | + '<input ng-model-options="{\'updateOn\': \'$inherit\'}">' + |
| 189 | + '</div>' + |
| 190 | + '</div>')($rootScope); |
| 191 | + |
| 192 | + var input1 = container.find('input').eq(0); |
| 193 | + var inputOptions1 = input1.controller('ngModelOptions').$options; |
| 194 | + |
| 195 | + expect(inputOptions1.getOption('updateOn')).toEqual('keyup'); |
| 196 | + expect(inputOptions1.getOption('updateOnDefault')).toEqual(false); |
| 197 | + |
| 198 | + var input2 = container.find('input').eq(1); |
| 199 | + var inputOptions2 = input2.controller('ngModelOptions').$options; |
| 200 | + |
| 201 | + expect(inputOptions2.getOption('updateOn')).toEqual('blur'); |
| 202 | + expect(inputOptions2.getOption('updateOnDefault')).toEqual(true); |
| 203 | + |
| 204 | + dealoc(container); |
| 205 | + }); |
| 206 | + |
| 207 | + |
183 | 208 | it('should make a copy of the options object', function() {
|
184 | 209 | $rootScope.options = {updateOn: 'default'};
|
185 | 210 | var inputElm = helper.compileInput(
|
|
0 commit comments