-
-
Notifications
You must be signed in to change notification settings - Fork 263
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(router): properly parse json response in the FormAction
- Loading branch information
1 parent
b104183
commit b5ee12b
Showing
5 changed files
with
62 additions
and
25 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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import * as newsletter from '../support/newsletter.po'; | ||
|
||
describe('Newsletter', () => { | ||
it(`Given the user has filled in their email | ||
When the "Submit" button is clicked | ||
Then the user has sign up for the newsletter`, () => { | ||
const email = '[email protected]'; | ||
cy.visit('/newsletter'); | ||
newsletter.typeEmail(email); | ||
|
||
newsletter.submit(); | ||
newsletter | ||
.getSubmitMessage() | ||
.should('have.text', `Thanks for signing up, ${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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export const typeEmail = (email: string) => | ||
cy.get('input[name="email"]').type(email); | ||
|
||
export const submit = () => cy.contains('button', /submit/i).click(); | ||
|
||
export const getSubmitMessage = () => cy.get('#signup-message'); |
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