Skip to content

Instantly share code, notes, and snippets.

Created July 1, 2015 07:18
Show Gist options
  • Save anonymous/da970a36fd25a1d2e218 to your computer and use it in GitHub Desktop.
Save anonymous/da970a36fd25a1d2e218 to your computer and use it in GitHub Desktop.
jPZWZd
<section ng-app>
<button ng-click="count = count + 1" ng-init="count=0">Downloads ({{count}})</button>
</section>
it('should check ng-click', function() {
expect(element(by.binding('count')).getText()).toMatch('0');
element(by.css('button')).click();
expect(element(by.binding('count')).getText()).toMatch('1');
});
<script src="//cdnjs.cloudflare.com/ajax/libs/angular.js/1.3.14/angular.min.js"></script>
section{
width:800px;
margin:0 auto;
text-align:center;
}
button{
width:180px;
height:50px;
font-size:18px;
text-transform:uppercase;
font-weigt:blod;
color:#fff;
background:#000;
border-left:none;
border-right:none;
border-top:1px solid red;
border-bottom:1px solid red;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment