-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into fix/add_client_side_validation_to_forms
- Loading branch information
Showing
6 changed files
with
13 additions
and
12 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
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
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 |
---|---|---|
|
@@ -37,7 +37,10 @@ describe("Login Page", () => { | |
cy.get("button[type='submit']").should("be.visible"); | ||
cy.get("button[type='submit']").click(); | ||
cy.get("[id='errorMessageusername']").should("be.visible"); | ||
cy.get("[id='errorMessageusername']").should("contain", "Enter a valid email address."); | ||
cy.get("[id='errorMessageusername']").should( | ||
"contain", | ||
"Enter a valid government email address." | ||
); | ||
}); | ||
it("Displays no error message when submitting a valid email", () => { | ||
cy.typeInField("input[id='username']", "[email protected]"); | ||
|
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 |
---|---|---|
|
@@ -24,14 +24,17 @@ describe("Register Page", () => { | |
it("Error on submitting a form with an invalid email", () => { | ||
cy.typeInField("input[id='username']", "myemail@email"); | ||
cy.get("[type='submit']").click(); | ||
cy.get("[id='errorMessageusername']").should("contain", "Enter a valid email address."); | ||
cy.get("[id='errorMessageusername']").should( | ||
"contain", | ||
"Enter a valid government email address." | ||
); | ||
}); | ||
it("Error on submitting a form with a non government email", () => { | ||
cy.typeInField("input[id='username']", "[email protected]"); | ||
cy.get("[type='submit']").click(); | ||
cy.get("[id='errorMessageusername']").should( | ||
"contain", | ||
"This field must be a valid federal government email" | ||
"Enter a valid government email address." | ||
); | ||
}); | ||
it("No error on submitting a form with a valid government email", () => { | ||
|
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 |
---|---|---|
|
@@ -463,6 +463,7 @@ describe("Gov Email domain validator", () => { | |
["[email protected]", false], | ||
["[email protected]", true], | ||
["[email protected]", true], | ||
["test.with'[email protected]", true], | ||
])(`Should return true if email is valid (testing "%s")`, async (email, isValid) => { | ||
expect(isValidGovEmail(email)).toBe(isValid); | ||
}); | ||
|