How do you choose an option in the angular directive?
var options = elem.find('#test-code-select option'); expect(angular.element(options[0]).text()).to.equal('234'); expect(angular.element(options[1]).text()).to.equal('236');
They work fine, but how can I force a manual selection of a parameter?
angular.element(options[1]).click(); //nope angular.element(options[1]).trigger('click'); //nope angular.element(options[1]).attr('selected', true); //nope
EDIT:
The directive template includes a choice with an internal ng model, I suspect this is causing the problem:
<select id='test-code-select' ng-options='code as code for code in codeList' ng-model='code'>
source share