forked from bountysource/core
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
enterprise fees tests. alert. use form validity to disable save
- Loading branch information
1 parent
c36a9a3
commit f033605
Showing
4 changed files
with
32 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,7 @@ <h1>Settings</h1> | |
<div class="control-group"> | ||
<label class="control-label" for="inputEmail">Primary Email:</label> | ||
<div class="controls"> | ||
<input type="email" id="inputEmail" name="email" placeholder="[email protected]" ng-model="form_data.email" class="input-xlarge" /> | ||
<input type="email" id="inputEmail" name="email" placeholder="[email protected]" ng-model="form_data.email" class="input-xlarge" required /> | ||
</div> | ||
</div> | ||
|
||
|
@@ -36,7 +36,7 @@ <h1>Settings</h1> | |
|
||
<div class="control-group"> | ||
<div class="controls"> | ||
<button type="submit" class="btn btn-success">Save</button> | ||
<button type="submit" class="btn btn-success" ng-disabled="form.$invalid">Save</button> | ||
</div> | ||
</div> | ||
</form> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -177,15 +177,15 @@ describe("Scenario: Editing Profile Information", function() { | |
Mock.pushScenario("/user", "GET", "success-email-auth"); | ||
element("a[ng-href='/settings/email']").click(); | ||
input("form_data.email").enter("lol"); | ||
element("button:contains('Save')").click(); | ||
expect(binding("error")).toBe("Unable to update email settings!"); | ||
expect(element("button:contains('Save')").attr("disabled")).toBe("disabled"); | ||
}); | ||
|
||
it("should allow saving of valid primary email address", function() { | ||
Mock.pushScenario("/user", "PUT", "success-new-email"); | ||
input("form_data.email").enter("[email protected]"); | ||
element("button:contains('Save')").click(); | ||
expect(binding("success")).toBe("Email settings updated!"); | ||
expect(element("button:contains('Save')").attr("disabled")).not().toBe("disabled"); | ||
expect(binding("alert.message")).toBe("Email settings updated!"); | ||
}); | ||
|
||
// it("should allow toggling of weekly newsletter", function() { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters