Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit ef42c65

Browse files
author
Erin Altenhof-Long
committed
test(select): add failing test for Firefox disabled select bug
A bug in Firefox prevents selecting the first option in a select if that option is disabled in a required select. The failure of this test documents the operation of this bug. Related to #7715
1 parent 4f45bf1 commit ef42c65

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

test/ng/directive/selectSpec.js

+20
Original file line numberDiff line numberDiff line change
@@ -754,6 +754,26 @@ describe('select', function() {
754754
expect(scope.selected).toBe(scope.values[0]);
755755
});
756756

757+
it('should allow the selection of a disabled option as the first element in a required select',
758+
function() {
759+
var html = '<select';
760+
html += ' required>';
761+
html += '<option value="" disabled>Choose One</option>';
762+
html += '<option value="1">Option One</option>';
763+
html += '</select>';
764+
765+
compile(html);
766+
767+
document.body.innerHTML = html;
768+
769+
var options = element.find('option');
770+
var optionToSelect = options.eq(0);
771+
expect(optionToSelect.text()).toBe('Choose One');
772+
expect(optionToSelect.prop('selected')).toBe(true);
773+
774+
dealoc(element);
775+
});
776+
757777
describe('binding', function() {
758778

759779
it('should bind to scope value', function() {

0 commit comments

Comments
 (0)