aboutsummaryrefslogtreecommitdiffstats
path: root/test/ng/directive
diff options
context:
space:
mode:
authorIgor Minar2012-08-10 15:38:05 -0700
committerIgor Minar2012-08-10 16:14:49 -0700
commit5540748890706c4b6b90ca6a9e55da2129306313 (patch)
treea27dc925208ec5f543d1dff860ce604fdc19d93c /test/ng/directive
parentf8a52be8176a068f12f456b832d35b9ee5d1f1e8 (diff)
downloadangular.js-5540748890706c4b6b90ca6a9e55da2129306313.tar.bz2
fix(option): support option elements in datalist
previously we expected to find option elements only within select element and if that was not the case we throw an error. This made it impossible to include datalist element with nested option elements in the template. Closes #1165
Diffstat (limited to 'test/ng/directive')
-rw-r--r--test/ng/directive/selectSpec.js15
1 files changed, 14 insertions, 1 deletions
diff --git a/test/ng/directive/selectSpec.js b/test/ng/directive/selectSpec.js
index 321990e8..c63d17bf 100644
--- a/test/ng/directive/selectSpec.js
+++ b/test/ng/directive/selectSpec.js
@@ -1108,7 +1108,7 @@ describe('select', function() {
});
- describe('OPTION value', function() {
+ describe('option', function() {
it('should populate value attribute on OPTION', function() {
compile('<select ng-model="x"><option selected>abc</option></select>');
@@ -1125,5 +1125,18 @@ describe('select', function() {
compile('<select ng-model="x"><option>hello</select>');
expect(element).toEqualSelect(['hello']);
});
+
+ it('should not blow up when option directive is found inside of a datalist',
+ inject(function($compile, $rootScope) {
+ var element = $compile('<div>' +
+ '<datalist><option>some val</option></datalist>' +
+ '<span>{{foo}}</span>' +
+ '</div>')($rootScope);
+
+ $rootScope.foo = 'success';
+ $rootScope.$digest();
+ expect(element.find('span').text()).toBe('success');
+ dealoc(element);
+ }));
});
});