mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-03-16 23:30:23 +00:00
corrected missbehaved example
This commit is contained in:
parent
c1caf2560a
commit
0f19cd3625
1 changed files with 5 additions and 1 deletions
|
|
@ -9,7 +9,9 @@ detection, and preventing invalid form submission.
|
|||
<doc:example>
|
||||
<doc:source>
|
||||
<script>
|
||||
function UserForm(){
|
||||
UserForm.$inject = ['$invalidWidgets'];
|
||||
function UserForm($invalidWidgets){
|
||||
this.$invalidWidgets = $invalidWidgets;
|
||||
this.state = /^\w\w$/;
|
||||
this.zip = /^\d\d\d\d\d$/;
|
||||
this.master = {
|
||||
|
|
@ -72,6 +74,8 @@ detection, and preventing invalid form submission.
|
|||
</doc:source>
|
||||
<doc:scenario>
|
||||
it('should enable save button', function(){
|
||||
expect(element(':button:contains(Save)').attr('disabled')).toBeTruthy();
|
||||
input('form.name').enter('');
|
||||
expect(element(':button:contains(Save)').attr('disabled')).toBeTruthy();
|
||||
input('form.name').enter('change');
|
||||
expect(element(':button:contains(Save)').attr('disabled')).toBeFalsy();
|
||||
|
|
|
|||
Loading…
Reference in a new issue