-
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.
* Updates support forms with new fields * Updates language strings * Updates unit test * Adds basic cypress test * PR updates * PR updates 2
- Loading branch information
1 parent
8c3caa0
commit 0300e33
Showing
6 changed files
with
224 additions
and
15 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
describe("Support Pages", () => { | ||
const supportFormTests = () => { | ||
it("Required fields stops submission", () => { | ||
cy.get("button[type='submit']").click(); | ||
cy.get("p[data-testid='errorMessage']").should("be.visible"); | ||
}); | ||
|
||
it("Invalid email stops submission", () => { | ||
cy.get("#email").type("bad@email"); | ||
cy.get("button[type='submit']").click(); | ||
cy.get("#errorMessageemail").should("be.visible"); | ||
}); | ||
|
||
it("Valid submission succeeds", () => { | ||
cy.get("#name").type("1"); | ||
cy.get("#email").type("good@email.com"); | ||
cy.get("#department").type("1"); | ||
cy.get("#branch").type("1"); | ||
cy.get("#jobTitle").type("1"); | ||
cy.get("label[for='request-question']").click(); | ||
cy.get("#description").type("1"); | ||
cy.get("button[type='submit']").click(); | ||
cy.get("h1").contains("Thank you for your request"); | ||
}); | ||
}; | ||
|
||
describe("Support Page", () => { | ||
beforeEach(() => { | ||
cy.useFlag("supportForms", true); | ||
cy.visit("/en/form-builder/support/"); | ||
}); | ||
|
||
it("English page loads", () => { | ||
cy.get("h1").should("contain", "Get support"); | ||
}); | ||
|
||
it("French page loads", () => { | ||
cy.get("a[lang='fr']").click(); | ||
cy.url().should("contain", "/fr"); | ||
cy.get("h1").should("contain", "Soutien"); | ||
}); | ||
|
||
supportFormTests(); | ||
}); | ||
|
||
describe("Contact Us Page", () => { | ||
beforeEach(() => { | ||
cy.useFlag("supportForms", true); | ||
cy.visit("/en/form-builder/support/contactus"); | ||
}); | ||
|
||
it("English page loads", () => { | ||
cy.get("h1").should("contain", "Contact us"); | ||
}); | ||
|
||
it("French page loads", () => { | ||
cy.get("a[lang='fr']").click(); | ||
cy.url().should("contain", "/fr"); | ||
cy.get("h1").should("contain", "Contactez-nous"); | ||
}); | ||
|
||
supportFormTests(); | ||
}); | ||
}); |
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
Oops, something went wrong.