Skip to content

Commit

Permalink
Adding pre-validation Cypress test (#1806)
Browse files Browse the repository at this point in the history
* Adding cross validation test

* Whitespace

---------

Co-authored-by: Phil Dominguez <“philip.dominguez@gsa.gov”>
  • Loading branch information
phildominguez-gsa and Phil Dominguez authored Aug 14, 2023
1 parent f4db871 commit bff3af3
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
12 changes: 8 additions & 4 deletions backend/cypress/e2e/full-submission.cy.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { testCrossValidation } from '../support/cross-validation.js';
import { testLoginGovLogin } from '../support/login-gov.js';
import { testValidAccess } from '../support/check-access.js';
import { testValidEligibility } from '../support/check-eligibility.js';
Expand Down Expand Up @@ -57,15 +58,18 @@ describe('Full audit submission', () => {
cy.get(".usa-link").contains("Additional UEIs").click();
testWorkbookAdditionalUEIs(false); // don't intercept

cy.get(".usa-link").contains("Pre-submission validation").click();
testCrossValidation();

// Uncomment this block when ready to implement the certification steps.
/*
// These aren't enabled because the previous steps didn't actually upload anything. Our upload responses are mocked.
// These aren't enabled because the previous steps didn't actually upload anything. Our upload responses are mocked.
// First step, pre-validation.
cy.get(".usa-link").contains("Pre-submission validation").click();
cy.url().should('match', /\/audit\/ready-for-certification\/[0-9A-Z]{17}/);
// Mock a prositive response on validation, then it comes back to the checklist
// Second, auditor certification
cy.get(".usa-link").contains("Auditor Certification").click();
// Two pages:
Expand All @@ -79,7 +83,7 @@ describe('Full audit submission', () => {
// Finally, submit for processing.
cy.get(".usa-link").contains("Submit to the FAC for processing").click();
// This will probably take you back to the homepage, where the audit is now oof status "submitted".
*/
});
});
8 changes: 8 additions & 0 deletions backend/cypress/support/cross-validation.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export function testCrossValidation() {
cy.url().should('match', /\/audit\/cross-validation\/[0-9A-Z]{17}/);
cy.get(".usa-button").contains("Begin Validation").click();
cy.get('.usa-fieldset').contains('Looks good!');

const reportTestId = '2023AUG0001000010';
cy.visit(`/audit/submission-progress/${reportTestId}`);
}

0 comments on commit bff3af3

Please sign in to comment.