mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-03-24 02:10:24 +00:00
feat(e2eRunner): fail when an option to select does not exist
This commit is contained in:
parent
2c405f4171
commit
15183f3e1f
2 changed files with 13 additions and 0 deletions
|
|
@ -298,6 +298,8 @@ angular.scenario.dsl('select', function() {
|
|||
option = select.find('option:contains("' + value + '")');
|
||||
if (option.length) {
|
||||
select.val(option.val());
|
||||
} else {
|
||||
return done("option '" + value + "' not found");
|
||||
}
|
||||
}
|
||||
select.trigger('change');
|
||||
|
|
|
|||
|
|
@ -269,6 +269,17 @@ describe("angular.scenario.dsl", function() {
|
|||
$root.dsl.select('test').options('A', 'B');
|
||||
expect($root.futureError).toMatch(/did not match/);
|
||||
});
|
||||
|
||||
it('should fail to select an option that does not exist', function(){
|
||||
doc.append(
|
||||
'<select ng-model="test">' +
|
||||
' <option value=A>one</option>' +
|
||||
' <option value=B selected>two</option>' +
|
||||
'</select>'
|
||||
);
|
||||
$root.dsl.select('test').option('three');
|
||||
expect($root.futureError).toMatch(/not found/);
|
||||
});
|
||||
});
|
||||
|
||||
describe('Element', function() {
|
||||
|
|
|
|||
Loading…
Reference in a new issue