-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add full name field to access and submission page #1797
Changes from all commits
77b00bb
5db0c6f
05a3703
196dc31
6c5ff38
c4b38d9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,9 +25,13 @@ describe('Create new audit', () => { | |
}); | ||
|
||
it('Fills out the Audit submission access', () => { | ||
cy.get('#certifying_auditee_contact_fullname').type('Real Full Name'); | ||
cy.get('#certifying_auditee_contact_email').type('va@test'); | ||
cy.get('#certifying_auditor_contact_email').type('[email protected]'); | ||
cy.get('#certifying_auditor_contact_fullname').type('A. Humanbeing'); | ||
cy.get('#auditee_contacts_fullname').type('Doe A. Deer'); | ||
cy.get('#auditee_contacts_email').type('[email protected]'); | ||
cy.get('#auditor_contacts_fullname').type('Percy Person'); | ||
cy.get('#auditor_contacts_email').type('[email protected]'); | ||
cy.get('#create').click(); | ||
cy.url().should('contain', '/report_submission/general-information/2023MAY0001000001'); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,23 @@ | ||
// reusable code for the accessandsubmission page | ||
const accessFields = [ | ||
'#certifying_auditee_contact_fullname', '#certifying_auditee_contact_email', '#certifying_auditee_contact_re_email', | ||
'#certifying_auditor_contact_fullname', '#certifying_auditor_contact_email', '#certifying_auditor_contact_re_email', | ||
'#auditee_contacts_fullname', '#auditee_contacts_email', '#auditee_contacts_re_email', | ||
'#auditor_contacts_fullname', '#auditor_contacts_email', '#auditor_contacts_re_email', | ||
]; | ||
|
||
export function addValidEmail(field) { | ||
export function addValidInfo(field) { | ||
const fieldType = field.split('_').pop(); | ||
cy.get(field) | ||
.clear() | ||
.type('[email protected]') | ||
.type(fieldType === 'email' ? '[email protected]' : 'Percy A. Person') | ||
.blur(); | ||
} | ||
|
||
function completeFormWithValidInfo() { | ||
[ | ||
'#certifying_auditee_contact_email', '#certifying_auditee_contact_re_email', | ||
'#certifying_auditor_contact_email', '#certifying_auditor_contact_re_email', | ||
'#auditee_contacts_email', '#auditee_contacts_re_email', | ||
'#auditor_contacts_email', '#auditor_contacts_re_email' | ||
].forEach(field => addValidEmail(field)) | ||
} | ||
|
||
export function testValidAccess() { | ||
completeFormWithValidInfo(); | ||
cy.wrap(accessFields).each((field) => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
addValidInfo(field); | ||
}); | ||
cy.get('.usa-button').contains('Create').click(); | ||
cy.url().should('contains', '/report_submission/general-information/'); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I put the new full name fields in their own row, which means two new rows are added each time you add a new contact.