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
Post a Comment