mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-05-26 14:43:59 +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:example>
|
||||||
<doc:source>
|
<doc:source>
|
||||||
<script>
|
<script>
|
||||||
function UserForm(){
|
UserForm.$inject = ['$invalidWidgets'];
|
||||||
|
function UserForm($invalidWidgets){
|
||||||
|
this.$invalidWidgets = $invalidWidgets;
|
||||||
this.state = /^\w\w$/;
|
this.state = /^\w\w$/;
|
||||||
this.zip = /^\d\d\d\d\d$/;
|
this.zip = /^\d\d\d\d\d$/;
|
||||||
this.master = {
|
this.master = {
|
||||||
|
|
@ -72,6 +74,8 @@ detection, and preventing invalid form submission.
|
||||||
</doc:source>
|
</doc:source>
|
||||||
<doc:scenario>
|
<doc:scenario>
|
||||||
it('should enable save button', function(){
|
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();
|
expect(element(':button:contains(Save)').attr('disabled')).toBeTruthy();
|
||||||
input('form.name').enter('change');
|
input('form.name').enter('change');
|
||||||
expect(element(':button:contains(Save)').attr('disabled')).toBeFalsy();
|
expect(element(':button:contains(Save)').attr('disabled')).toBeFalsy();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue