-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1709 from fecgov/release/sprint-37
Release/sprint 37
- Loading branch information
Showing
286 changed files
with
10,464 additions
and
4,555 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
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
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,43 @@ | ||
import { | ||
defaultFormData as reportFormData, | ||
defaultFormData as defaultReportFormData, | ||
F3xCreateReportFormData | ||
} from "../models/ReportFormModel"; | ||
import { ContactListPage } from "../pages/contactListPage"; | ||
import { ReportListPage } from "../pages/reportListPage"; | ||
import { currentYear } from "../pages/pageUtils"; | ||
|
||
export interface Setup { | ||
organization?: boolean; | ||
individual?: boolean; | ||
candidate?: boolean; | ||
committee?: boolean; | ||
report?: F3xCreateReportFormData; | ||
} | ||
|
||
export function F3XSetup(setup: Setup = {}) { | ||
if (setup.individual) ContactListPage.createIndividual(); | ||
if (setup.organization) ContactListPage.createOrganization(); | ||
if (setup.candidate) ContactListPage.createCandidate(); | ||
if (setup.committee) ContactListPage.createCommittee(); | ||
ReportListPage.createF3X(setup.report ?? defaultReportFormData); | ||
} | ||
|
||
|
||
export const reportFormDataApril: F3xCreateReportFormData = { | ||
...reportFormData, | ||
...{ | ||
report_code: 'Q1', | ||
coverage_from_date: new Date(currentYear, 0, 1), | ||
coverage_through_date: new Date(currentYear, 3, 30), | ||
}, | ||
}; | ||
|
||
export const reportFormDataJuly: F3xCreateReportFormData = { | ||
...reportFormData, | ||
...{ | ||
report_code: 'Q2', | ||
coverage_from_date: new Date(currentYear, 4, 1), | ||
coverage_through_date: new Date(currentYear, 7, 30), | ||
}, | ||
}; |
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,104 @@ | ||
import { ContactListPage } from '../pages/contactListPage'; | ||
import { LoginPage } from '../pages/loginPage'; | ||
import { currentYear, PageUtils } from '../pages/pageUtils'; | ||
import { ReportListPage } from '../pages/reportListPage'; | ||
import { TransactionDetailPage } from '../pages/transactionDetailPage'; | ||
import { | ||
ContactFormData, | ||
ContactType, | ||
createContact, | ||
defaultFormData as individualContactFormData, | ||
} from '../models/ContactFormModel'; | ||
import { StartTransaction } from './start-transaction/start-transaction'; | ||
import { F3XSetup, reportFormDataApril, reportFormDataJuly } from './f3x-setup'; | ||
import { ScheduleFormData } from '../models/TransactionFormModel'; | ||
import { Individual } from './start-transaction/receipts'; | ||
|
||
const APRIL_15 = 'APRIL 15'; | ||
|
||
const receiptData: ScheduleFormData = { | ||
amount: 100.55, | ||
category_code: '', | ||
date_received: new Date(currentYear, 4 - 1, 27), | ||
electionType: undefined, | ||
electionYear: undefined, | ||
election_other_description: '', | ||
purpose_description: PageUtils.randomString(20), | ||
memo_code: false, | ||
memo_text: PageUtils.randomString(20), | ||
}; | ||
|
||
const reattributeData: ScheduleFormData = { | ||
amount: 100.55, | ||
category_code: '', | ||
date_received: new Date(currentYear, 4 - 1, 27), | ||
electionType: undefined, | ||
electionYear: undefined, | ||
election_other_description: '', | ||
purpose_description: undefined, | ||
memo_code: false, | ||
memo_text: '', | ||
}; | ||
|
||
const assignee: ContactFormData = createContact(ContactType.INDIVIDUAL); | ||
|
||
function CreateReceipt() { | ||
F3XSetup({ individual: true, candidate: true, report: reportFormDataApril }); | ||
StartTransaction.Receipts().Individual().IndividualReceipt(); | ||
|
||
cy.get('[role="searchbox"]').type(individualContactFormData.last_name.slice(0, 1)); | ||
cy.contains(individualContactFormData.last_name).should('exist'); | ||
cy.contains(individualContactFormData.last_name).click(); | ||
TransactionDetailPage.enterScheduleFormData(new ScheduleFormData(receiptData)); | ||
|
||
PageUtils.clickButton('Save'); | ||
PageUtils.urlCheck('/list'); | ||
cy.contains(Individual.INDIVIDUAL_RECEIPT).should('exist'); | ||
} | ||
|
||
function Reattribute(old = false) { | ||
PageUtils.getKabob(' 11(a)(ii) ').contains('Reattribute').first().click({ force: true }); | ||
const alias = PageUtils.getAlias(''); | ||
if (old) { | ||
const selector = cy.get(alias).find('#report-selector'); | ||
selector.select('FORM 3X: JULY 15 QUARTERLY REPORT (Q2)'); | ||
PageUtils.clickButton('Continue'); | ||
} | ||
cy.wait(500); | ||
|
||
cy.get('[role="searchbox"]').type(assignee.last_name.slice(0, 1)); | ||
cy.contains(assignee.last_name).should('exist'); | ||
cy.contains(assignee.last_name).click(); | ||
TransactionDetailPage.enterScheduleFormData(new ScheduleFormData(reattributeData)); | ||
|
||
PageUtils.clickButton('Save'); | ||
PageUtils.urlCheck('/list'); | ||
cy.contains(Individual.INDIVIDUAL_RECEIPT).should('exist'); | ||
} | ||
|
||
describe('Reattributions', () => { | ||
beforeEach(() => { | ||
LoginPage.login(); | ||
ReportListPage.deleteAllReports(); | ||
ContactListPage.deleteAllContacts(); | ||
}); | ||
|
||
it('should test reattributing a Schedule A in the current report', () => { | ||
// Create an individual contact to be used as reattributor to | ||
ContactListPage.createIndividual(assignee); | ||
CreateReceipt(); | ||
Reattribute(); | ||
}); | ||
|
||
it('should test reattributing a Schedule A in a submitted report', () => { | ||
// Create an individual contact to be used with contact lookup | ||
ContactListPage.createIndividual(assignee); | ||
CreateReceipt(); | ||
ReportListPage.createF3X(reportFormDataJuly); | ||
ReportListPage.submitReport(APRIL_15); | ||
ReportListPage.editReport(APRIL_15, 'Review report'); | ||
PageUtils.clickSidebarSection('REVIEW TRANSACTIONS'); | ||
cy.wait(500); | ||
Reattribute(true); | ||
}); | ||
}); |
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,89 @@ | ||
import { ContactListPage } from '../pages/contactListPage'; | ||
import { LoginPage } from '../pages/loginPage'; | ||
import { PageUtils } from '../pages/pageUtils'; | ||
import { ReportListPage } from '../pages/reportListPage'; | ||
import { TransactionDetailPage } from '../pages/transactionDetailPage'; | ||
import { candidateFormData, committeeFormData } from '../models/ContactFormModel'; | ||
import { StartTransaction } from './start-transaction/start-transaction'; | ||
import { F3XSetup, reportFormDataApril, reportFormDataJuly } from './f3x-setup'; | ||
import { | ||
ContributionFormData, | ||
defaultScheduleFormData as defaultTransactionFormData, | ||
} from '../models/TransactionFormModel'; | ||
import { Contributions } from './start-transaction/disbursements'; | ||
|
||
const APRIL_15 = 'APRIL 15'; | ||
|
||
const contributionData: ContributionFormData = { | ||
...defaultTransactionFormData, | ||
...{ | ||
candidate: candidateFormData.candidate_id, | ||
}, | ||
}; | ||
|
||
const redesignationData: ContributionFormData = { | ||
...defaultTransactionFormData, | ||
...{ | ||
electionType: 'P', | ||
purpose_description: undefined, | ||
category_code: undefined, | ||
}, | ||
}; | ||
|
||
function CreateContribution() { | ||
F3XSetup({ committee: true, candidate: true, report: reportFormDataApril }); | ||
|
||
StartTransaction.Disbursements().Contributions().ToCandidate(); | ||
|
||
cy.get('[role="searchbox"]').type(committeeFormData.name.slice(0, 1)); | ||
cy.contains(committeeFormData.name).should('exist'); | ||
cy.contains(committeeFormData.name).click(); | ||
|
||
TransactionDetailPage.enterScheduleFormDataForContribution(contributionData); | ||
|
||
PageUtils.clickButton('Save'); | ||
PageUtils.urlCheck('/list'); | ||
cy.contains(Contributions.TO_CANDIDATE).should('exist'); | ||
} | ||
|
||
function Redesignate(old = false) { | ||
PageUtils.getKabob(Contributions.TO_CANDIDATE).contains('Redesignate').first().click({ force: true }); | ||
const alias = PageUtils.getAlias(''); | ||
if (old) { | ||
const selector = cy.get(alias).find('#report-selector'); | ||
selector.select('FORM 3X: JULY 15 QUARTERLY REPORT (Q2)'); | ||
PageUtils.clickButton('Continue'); | ||
} | ||
cy.wait(500); | ||
|
||
TransactionDetailPage.enterScheduleFormDataForContribution(new ContributionFormData(redesignationData)); | ||
|
||
PageUtils.clickButton('Save'); | ||
PageUtils.urlCheck('/list'); | ||
cy.contains(Contributions.TO_CANDIDATE).should('exist'); | ||
} | ||
|
||
describe('Redesignations', () => { | ||
beforeEach(() => { | ||
LoginPage.login(); | ||
ReportListPage.deleteAllReports(); | ||
ContactListPage.deleteAllContacts(); | ||
}); | ||
|
||
it('should test redesignating a Schedule E contribution in the current report', () => { | ||
// Create an individual contact to be used as reattributor to | ||
CreateContribution(); | ||
Redesignate(); | ||
}); | ||
|
||
it('should test redesignating a Schedule E contribution from a submitted report', () => { | ||
// Create an individual contact to be used with contact lookup | ||
CreateContribution(); | ||
ReportListPage.createF3X(reportFormDataJuly); | ||
ReportListPage.submitReport(APRIL_15); | ||
ReportListPage.editReport(APRIL_15, 'Review report'); | ||
PageUtils.clickSidebarSection('REVIEW TRANSACTIONS'); | ||
cy.wait(500); | ||
Redesignate(true); | ||
}); | ||
}); |
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
Oops, something went wrong.