Skip to content

Commit 9b14639

Browse files
test(select): add tests for option element with no value attribute
See angular#6519
1 parent a319b98 commit 9b14639

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
@@ -318,6 +318,26 @@ describe('select', function() {
318318
});
319319

320320

321+
it('should support option without a value attribute', function() {
322+
compile('<select ng-model="robot">' +
323+
'<option>--select--</option>' +
324+
'<option value="x">robot x</option>' +
325+
'<option value="y">robot y</option>' +
326+
'</select>');
327+
expect(element).toEqualSelect(["? undefined:undefined ?"], "--select--", 'x', 'y');
328+
});
329+
330+
331+
it('should support option without a value with other HTML attributes', function() {
332+
compile('<select ng-model="robot">' +
333+
'<option data-foo="bar">--select--</option>' +
334+
'<option value="x">robot x</option>' +
335+
'<option value="y">robot y</option>' +
336+
'</select>');
337+
expect(element).toEqualSelect(["? undefined:undefined ?"], "--select--", 'x', 'y');
338+
});
339+
340+
321341
describe('interactions with repeated options', function() {
322342

323343
it('should select empty option when model is undefined', function() {

0 commit comments

Comments
 (0)