Skip to content

Commit

Permalink
catch up to main
Browse files Browse the repository at this point in the history
  • Loading branch information
danswick committed Oct 20, 2023
2 parents 74f0bc3 + ae5c6e9 commit eb0e534
Show file tree
Hide file tree
Showing 23 changed files with 231 additions and 625 deletions.
59 changes: 8 additions & 51 deletions backend/cypress/e2e/additional-eins.cy.js
Original file line number Diff line number Diff line change
@@ -1,65 +1,22 @@
import 'cypress-file-upload';
import { testCrossValidation } from '../support/cross-validation.js';
import { testLoginGovLogin } from '../support/login-gov.js';
//import { testLogoutGov } from '../support/logout-gov.js';
import { testValidAccess } from '../support/check-access.js';
import { testValidEligibility } from '../support/check-eligibility.js';
import { testValidAuditeeInfo } from '../support/auditee-info.js';
import { testValidGeneralInfo } from '../support/general-info.js';
import { testReportIdFound, testReportIdNotFound } from '../support/dissemination-table.js';
import { testFederalAwards } from '../support/federal-awards.js';
import { testFileUploadMsg } from '../support/file-uploaded-msg.js';

import { testLoginGovLogin } from '../support/login-gov.js';
import {
testWorkbookAdditionalEINs,
testWorkbookFederalAwards,
testWorkbookAdditionalEINs,
} from '../support/workbook-uploads.js';

const LOGIN_TEST_EMAIL_AUDITEE = Cypress.env('LOGIN_TEST_EMAIL_AUDITEE');
const LOGIN_TEST_PASSWORD_AUDITEE = Cypress.env('LOGIN_TEST_PASSWORD_AUDITEE');
const LOGIN_TEST_OTP_SECRET_AUDITEE = Cypress.env('LOGIN_TEST_OTP_SECRET_AUDITEE');

describe('Additional EINs page', () => {
before(() => {
cy.session('login-session', () => {
cy.visit('/');
cy.login();
});
});

it('Additional EINs uploads successfully', () => {
cy.visit('/');

cy.url().should('include', '/');
testLoginGovLogin();
});

cy.get('label[for=check-start-new-submission]').click();

cy.get('.usa-button').contains('Accept and start').click();

cy.url().should('match', /\/report_submission\/eligibility\/$/);

testValidEligibility();

testValidAuditeeInfo();

testValidAccess();

// Report should not yet be in the dissemination table
cy.url().then(url => {
const reportId = url.split('/').pop();
testReportIdNotFound(reportId);
});

testValidGeneralInfo();

cy.get(".usa-link").contains("Federal Awards").click();
testWorkbookFederalAwards(false);

it('Additional EINs uploads successfully', () => {
testFederalAwards();
cy.get(".usa-link").contains("Additional EINs").click();
testWorkbookAdditionalEINs(false);
});

it('Displays message if file has already been uploaded', () => {
testFileUploadMsg('Edit the Additional EINs');
});

});
});
59 changes: 8 additions & 51 deletions backend/cypress/e2e/additional-ueis.cy.js
Original file line number Diff line number Diff line change
@@ -1,65 +1,22 @@
import 'cypress-file-upload';
import { testCrossValidation } from '../support/cross-validation.js';
import { testLoginGovLogin } from '../support/login-gov.js';
//import { testLogoutGov } from '../support/logout-gov.js';
import { testValidAccess } from '../support/check-access.js';
import { testValidEligibility } from '../support/check-eligibility.js';
import { testValidAuditeeInfo } from '../support/auditee-info.js';
import { testValidGeneralInfo } from '../support/general-info.js';
import { testReportIdFound, testReportIdNotFound } from '../support/dissemination-table.js';
import { testFederalAwards } from '../support/federal-awards.js';
import { testFileUploadMsg } from '../support/file-uploaded-msg.js';

import { testLoginGovLogin } from '../support/login-gov.js';
import {
testWorkbookAdditionalUEIs,
testWorkbookFederalAwards,
testWorkbookAdditionalUEIs,
} from '../support/workbook-uploads.js';

const LOGIN_TEST_EMAIL_AUDITEE = Cypress.env('LOGIN_TEST_EMAIL_AUDITEE');
const LOGIN_TEST_PASSWORD_AUDITEE = Cypress.env('LOGIN_TEST_PASSWORD_AUDITEE');
const LOGIN_TEST_OTP_SECRET_AUDITEE = Cypress.env('LOGIN_TEST_OTP_SECRET_AUDITEE');

describe('Additional UEIs page', () => {
before(() => {
cy.session('login-session', () => {
cy.visit('/');
cy.login();
});
});

it('Additional UEIs uploads successfully', () => {
cy.visit('/');

cy.url().should('include', '/');
testLoginGovLogin();
});

cy.get('label[for=check-start-new-submission]').click();

cy.get('.usa-button').contains('Accept and start').click();

cy.url().should('match', /\/report_submission\/eligibility\/$/);

testValidEligibility();

testValidAuditeeInfo();

testValidAccess();

// Report should not yet be in the dissemination table
cy.url().then(url => {
const reportId = url.split('/').pop();
testReportIdNotFound(reportId);
});

testValidGeneralInfo();

cy.get(".usa-link").contains("Federal Awards").click();
testWorkbookFederalAwards(false);

it('Additional UEIs uploads successfully', () => {
testFederalAwards();
cy.get(".usa-link").contains("Additional UEIs").click();
testWorkbookAdditionalUEIs(false);
});

it('Displays message if file has already been uploaded', () => {
testFileUploadMsg('Edit the Additional UEIs');
});

});
});
55 changes: 6 additions & 49 deletions backend/cypress/e2e/audit-findings-text.cy.js
Original file line number Diff line number Diff line change
@@ -1,65 +1,22 @@
import 'cypress-file-upload';
import { testCrossValidation } from '../support/cross-validation.js';
import { testLoginGovLogin } from '../support/login-gov.js';
//import { testLogoutGov } from '../support/logout-gov.js';
import { testValidAccess } from '../support/check-access.js';
import { testValidEligibility } from '../support/check-eligibility.js';
import { testValidAuditeeInfo } from '../support/auditee-info.js';
import { testValidGeneralInfo } from '../support/general-info.js';
import { testReportIdFound, testReportIdNotFound } from '../support/dissemination-table.js';
import { testFederalAwards } from '../support/federal-awards.js';
import { testFileUploadMsg } from '../support/file-uploaded-msg.js';

import { testLoginGovLogin } from '../support/login-gov.js';
import {
testWorkbookFederalAwards,
testWorkbookFindingsText,
} from '../support/workbook-uploads.js';

const LOGIN_TEST_EMAIL_AUDITEE = Cypress.env('LOGIN_TEST_EMAIL_AUDITEE');
const LOGIN_TEST_PASSWORD_AUDITEE = Cypress.env('LOGIN_TEST_PASSWORD_AUDITEE');
const LOGIN_TEST_OTP_SECRET_AUDITEE = Cypress.env('LOGIN_TEST_OTP_SECRET_AUDITEE');

describe('Audit Findings Text page', () => {
before(() => {
cy.session('login-session', () => {
cy.visit('/');
cy.login();
});
});

it('Audit Findings Text uploads successfully', () => {
cy.visit('/');

cy.url().should('include', '/');
testLoginGovLogin();
});

cy.get('label[for=check-start-new-submission]').click();

cy.get('.usa-button').contains('Accept and start').click();

cy.url().should('match', /\/report_submission\/eligibility\/$/);

testValidEligibility();

testValidAuditeeInfo();

testValidAccess();

// Report should not yet be in the dissemination table
cy.url().then(url => {
const reportId = url.split('/').pop();
testReportIdNotFound(reportId);
});

testValidGeneralInfo();

cy.get(".usa-link").contains("Federal Awards").click();
testWorkbookFederalAwards(false);

it('Audit Findings Text uploads successfully', () => {
testFederalAwards();
cy.get(".usa-link").contains("Federal Awards Audit Findings Text").click();
testWorkbookFindingsText(false);
});

it('Displays message if file has already been uploaded', () => {
testFileUploadMsg('Edit the Federal Awards Audit Findings Text');
});

});
59 changes: 6 additions & 53 deletions backend/cypress/e2e/audit-findings.cy.js
Original file line number Diff line number Diff line change
@@ -1,69 +1,22 @@
import 'cypress-file-upload';
import { testCrossValidation } from '../support/cross-validation.js';
import { testLoginGovLogin } from '../support/login-gov.js';
//import { testLogoutGov } from '../support/logout-gov.js';
import { testValidAccess } from '../support/check-access.js';
import { testValidEligibility } from '../support/check-eligibility.js';
import { testValidAuditeeInfo } from '../support/auditee-info.js';
import { testValidGeneralInfo } from '../support/general-info.js';
import { testReportIdFound, testReportIdNotFound } from '../support/dissemination-table.js';
import { testFederalAwards } from '../support/federal-awards.js';
import { testFileUploadMsg } from '../support/file-uploaded-msg.js';

import { testLoginGovLogin } from '../support/login-gov.js';
import {
testWorkbookFederalAwards,
testWorkbookFindingsUniformGuidance,
} from '../support/workbook-uploads.js';

const LOGIN_TEST_EMAIL_AUDITEE = Cypress.env('LOGIN_TEST_EMAIL_AUDITEE');
const LOGIN_TEST_PASSWORD_AUDITEE = Cypress.env('LOGIN_TEST_PASSWORD_AUDITEE');
const LOGIN_TEST_OTP_SECRET_AUDITEE = Cypress.env('LOGIN_TEST_OTP_SECRET_AUDITEE');

describe('Audit Findings page', () => {
before(() => {
cy.session('login-session', () => {
cy.visit('/');
cy.login();
});
});

it('Audit Findings uploads successfully', () => {
cy.visit('/');

cy.url().should('include', '/');
testLoginGovLogin();
});

cy.get('label[for=check-start-new-submission]').click();

cy.get('.usa-button').contains('Accept and start').click();

cy.url().should('match', /\/report_submission\/eligibility\/$/);

testValidEligibility();

testValidAuditeeInfo();

testValidAccess();

// Report should not yet be in the dissemination table
cy.url().then(url => {
const reportId = url.split('/').pop();
testReportIdNotFound(reportId);
});

testValidGeneralInfo();

cy.get('.usa-link').contains("Federal Awards").click();
testWorkbookFederalAwards(false);

it('Audit Findings uploads successfully', () => {
testFederalAwards();
cy.get(".usa-link").contains("Federal Awards Audit Findings").click();
testWorkbookFindingsUniformGuidance(false);

});

it('Displays message if file has already been uploaded', () => {
testFileUploadMsg('Edit the Federal Awards Audit Findings');
});

});



64 changes: 9 additions & 55 deletions backend/cypress/e2e/audit-report-pdf.cy.js
Original file line number Diff line number Diff line change
@@ -1,66 +1,20 @@
import 'cypress-file-upload';
import { testCrossValidation } from '../support/cross-validation.js';
import { testFederalAwards } from '../support/federal-awards.js';
import { testFileUploadMsg } from '../support/file-uploaded-msg.js';
import { testLoginGovLogin } from '../support/login-gov.js';
//import { testLogoutGov } from '../support/logout-gov.js';
import { testValidAccess } from '../support/check-access.js';
import { testValidEligibility } from '../support/check-eligibility.js';
import { testValidAuditeeInfo } from '../support/auditee-info.js';
import { testValidGeneralInfo } from '../support/general-info.js';
import { testPdfAuditReport } from '../support/report-pdf.js';

import {
testWorkbookFederalAwards,
} from '../support/workbook-uploads.js';

const LOGIN_TEST_EMAIL_AUDITEE = Cypress.env('LOGIN_TEST_EMAIL_AUDITEE');
const LOGIN_TEST_PASSWORD_AUDITEE = Cypress.env('LOGIN_TEST_PASSWORD_AUDITEE');
const LOGIN_TEST_OTP_SECRET_AUDITEE = Cypress.env('LOGIN_TEST_OTP_SECRET_AUDITEE');
import { testPdfAuditReport } from '../support/report-pdf.js';

describe('Audit report PDF page', () => {
before(() => {
cy.session('login-session', () => {
cy.visit('/');
cy.login();
});
});

it('Audit report PDF uploads successfully', () => {
cy.visit('/');

cy.url().should('include', '/');
testLoginGovLogin();
});

cy.get('label[for=check-start-new-submission]').click();

cy.get('.usa-button').contains('Accept and start').click();

cy.url().should('match', /\/report_submission\/eligibility\/$/);

testValidEligibility();

testValidAuditeeInfo();

testValidAccess();

testValidGeneralInfo();

cy.get(".usa-link").contains("Federal Awards").click();
testWorkbookFederalAwards(false);

it('Audit report PDF uploads successfully', () => {
testFederalAwards();
cy.get(".usa-link").contains("Audit report PDF").click();
testPdfAuditReport(false);
testFileUploadMsg('Edit the Audit report PDF');
});

it('Displays message if file has already been uploaded', () => {
cy.visit(`/audit/`);
cy.url().should('match', /\/audit\//);
cy.get(':nth-child(4) > .usa-table > tbody > tr').last().find('td:nth-child(1)>.usa-link').click();
cy.get('.usa-link').contains('Edit the Audit report PDF').click();
cy.get('#already-submitted')
.invoke('text')
.then((text) => {
const expectedText = 'A file has already been uploaded for this section. A successful reupload will overwrite your previous submission.';
expect(text.trim()).to.equal(expectedText);
});
});

});
});
Loading

0 comments on commit eb0e534

Please sign in to comment.