Unable to simulate click action on radio button in unit test.
This is the 'it' block :
var element = '<div> <my-directive></my-directive></div>';
element = $compile(element)($rootScope);
$rootScope.$digest();
var radio1Button = element.find('input')[1];
var radio2Button = element.find('input')[2];
angular.element(radio2Button).trigger('click');
expect(radioModel).toBe('radio2Button');
This test is failing , expected is radio2button should get clicked and the ng-model value will change from radio1Button to radio2Button.