angularjs - Binding selector 'salutation' did not match -


i'm having trouble testing binding in e2e test. here code:

html:

<select ng-model="salutation" ng-options="s.value s in salutations">   <option value="">please choose</option> </select> 

controller:

function mainctrl($scope) {   $scope.salutations = [{     key: "male",     value: "mr."   }, {     key: "female",     value: "mrs."   }];     $scope.salutation = salutations[0]; } 

e2e test:

... describe('form', function() {   it('should initialize model', function() {     expect(binding('salutation')).tomatch('mr.');   });  }); ... 

when running e2e test error message:

select binding 'salutation' binding selector 'salutation' did not match.    <span>{{salutation}}</span> 

thx!

update: closed in favour of new question why doesn't binding() find two-way-binding in e2e test?

i don't think page binding works since salutations not in $scope, need change to

function mainctrl($scope) {     $scope.salutations = [{         key: "male",         value: "mr."     }, {         key: "female",         value: "mrs."     }];     $scope.salutation = $scope.salutations[0]; } 

Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -