Skip to content

Commit

Permalink
Fix inconsistent case where datepicker fails to click (#4237)
Browse files Browse the repository at this point in the history
Sometimes the full-submission tests fail on this line - it seems that the datepicker component does not always respond to .click(), and causes a timeout when the next step attempts to select today's date.

To my understanding it seems `.trigger('click')` is another approach that fares better in cases where `.click()` might fail. I have tested this many times and have yet for Cypress to break on my end with this new line.
  • Loading branch information
rnovak338 authored Aug 28, 2024
1 parent 44d4933 commit 5d5e5e8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion backend/cypress/support/auditee-certification.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export function testAuditeeCertification() {
// 2. Sign and date, submit and go back to checklist
cy.get('#auditee_name').type('John Doe');
cy.get('#auditee_title').type('Auditee');
cy.get('.usa-date-picker__button').click();
cy.get('.usa-date-picker__button').trigger('click');
cy.get('.usa-date-picker__calendar__date--today').click();
cy.get('.usa-button').contains('Agree to auditee certification').click();
};
2 changes: 1 addition & 1 deletion backend/cypress/support/auditor-certification.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export function testAuditorCertification() {
// 2. Sign and date, submit and go back to checklist
cy.get('#auditor_name').type('Jane Doe');
cy.get('#auditor_title').type('Auditor');
cy.get('.usa-date-picker__button').click();
cy.get('.usa-date-picker__button').trigger('click');
cy.get('.usa-date-picker__calendar__date--today').click();
cy.get('.usa-button').contains('Agree to auditor certification').click();
};

0 comments on commit 5d5e5e8

Please sign in to comment.