JSFiddle - React, Tailwind, and code Playground
by bpall
HTML
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js">
</script>
<script>
it('should check both checkBoxes', function() {
expect(element(by.id('checkFollower')).getAttribute('checked')).toBeFalsy();
element(by.model('leader')).click();
expect(element(by.id('checkFollower')).getAttribute('checked')).toBeTruthy();
});
</script>
<label>Check me to check both: <input type="checkbox" ng-model="leader"></label><br/>
<input id="checkFollower" type="checkbox" ng-checked="leader" aria-label="Follower input">
JavaScript
it('should check both checkBoxes', function() {
expect(element(by.id('checkFollower')).getAttribute('checked')).toBeFalsy();
element(by.model('leader')).click();
expect(element(by.id('checkFollower')).getAttribute('checked')).toBeTruthy();
});
angular.module('myApp', [])
.directive('counter', function () {
return {
restrict: 'A',
link: function (scope, el, attrs) {
// read element attribute if it exists
var incr = parseInt(attrs.incr || 1)
, val = 0;
// define callback for vanilla DOM click event
el.bind('click', function () {
el.html(val += incr);
});
}
};
});