Skip to content

Commit

Permalink
Merge pull request #474 from fecgov/feature/429-update-transaction-names
Browse files Browse the repository at this point in the history
Rename transactions
  • Loading branch information
Elaine-Krauss-TCG authored Aug 17, 2022
2 parents df53774 + ee3229e commit d5c54ca
Show file tree
Hide file tree
Showing 11 changed files with 57 additions and 61 deletions.
37 changes: 17 additions & 20 deletions front-end/cypress/integration/sprint-10/sprint-10-test-347.spec.ts
Original file line number Diff line number Diff line change
@@ -1,42 +1,39 @@
import { generateReportObject } from "../../support/generators/reports.spec";
import { generateTransactionObject } from "../../support/generators/transactions.spec";
import { createTransactionSchA } from "../../support/transactions.spec";

import { generateReportObject } from '../../support/generators/reports.spec';
import { generateTransactionObject } from '../../support/generators/transactions.spec';
import { createTransactionSchA } from '../../support/transactions.spec';

describe('QA Script 347 (Sprint 10)', () => {
before('Logs in and creates a dummy report', () => {
cy.login();
const report = generateReportObject();
cy.createReport(report);
cy.get('p-button[icon="pi pi-pencil"]')
.click();
cy.get('p-button[icon="pi pi-pencil"]').click();
cy.progressReport();
});

it(`Tests the summary page for a report`, ()=>{
it(`Tests the summary page for a report`, () => {
const transactionTree = generateTransactionObject({
"TRANSFERS":{
"JF Transfers":{}
}
TRANSFERS: {
'Joint Fundraising Transfer': {},
},
});
createTransactionSchA(transactionTree);
cy.medWait();
const parentTransaction = transactionTree["TRANSFERS"]["JF Transfers"];
const childTransaction = parentTransaction["childTransactions"][0];
const childName = childTransaction["contributorOrganizationName"];
const parentTransaction = transactionTree['TRANSFERS']['Joint Fundraising Transfer'];
const childTransaction = parentTransaction['childTransactions'][0];
const childName = childTransaction['contributorOrganizationName'];

cy.contains("tr",parentTransaction["contributorOrganizationName"])
.find(">td")
cy.contains('tr', parentTransaction['contributorOrganizationName'])
.find('>td')
.eq(6)
.then(($td)=>{
.then(($td) => {
const parentId = $td.text();
cy.contains("tr", childName).find("td").eq(7).should("have.text", parentId);
cy.contains('tr', childName).find('td').eq(7).should('have.text', parentId);
});

});

it("Cleanup", ()=>{
it('Cleanup', () => {
cy.deleteAllReports();
cy.logout();
});
});
});
14 changes: 7 additions & 7 deletions front-end/cypress/integration/sprint-8/sprint-8-test-228.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,20 @@ const accordion = {
],
TRANSFERS: [
'Transfers',
'JF Transfers',
'Joint Fundraising Transfer',
'In-Kind Transfer',
'In-Kind Transfer-FEA',
'JF Transfer - National Party Recount Account',
'JF Transfer - National Party Convention Account',
'JF Transfer - National Party Headquarters Account',
'In-Kind Transfer - Federal Election Activity',
'Joint Fundraising Transfer - National Party Recount Account',
'Joint Fundraising Transfer - National Party Convention Account',
'Joint Fundraising Transfer - National Party Headquarters Account',
],
REFUNDS: ['Refunds of Contributions to Registered Committees', 'Refunds of Contributions to Unregistered Committees'],
OTHER: [
'Offsets to Operating Expenditures',
'Other Receipts',
'Ind. Receipt - Non-Contribution Account',
'Individual Receipt - Non-Contribution Account',
'Other Committee Receipt - Non-Contribution Account',
'Business/Labor Org. Receipt - Non-Contribution Account',
'Business/Labor Organization Receipt - Non-Contribution Account',
'Individual Recount Receipt',
'Party Recount Receipt',
'PAC Recount Receipt',
Expand Down
12 changes: 6 additions & 6 deletions front-end/cypress/support/transaction_nav_trees.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export type TransactionCategory = 'INDIVIDUALS/PERSONS' | 'REGISTERED FILERS' |
export type SchATransaction =
| 'Individual Receipt'
| 'Tribal Receipt'
| 'JF Transfers'
| 'Joint Fundraising Transfer'
| 'Offsets to Operating Expenditures'
| 'Other Receipts';

Expand All @@ -50,7 +50,7 @@ export type TransactionForm = {
contributorZip?: TransactionField;
memoTextDescription?: TransactionField;
contributionAmount?: TransactionField;
childTransactions?: TransactionForm[]
childTransactions?: TransactionForm[];
};

export type FieldType = 'Text' | 'Calendar' | 'Dropdown' | 'P-InputNumber' | 'Textarea';
Expand Down Expand Up @@ -342,10 +342,10 @@ const JFTransferMemo: TransactionForm = {
...groupNameFields,
...addressFields,
...memoFields,
...contributionFields
}
...contributionFields,
};

const JFTransfer: TransactionForm = {
const JointFundraisingTransfer: TransactionForm = {
...entityCommittee,
...donorCommitteeFECId,
...groupNameFields,
Expand Down Expand Up @@ -389,7 +389,7 @@ export const groupANavTree: TransactionNavTree = {
},
//"REGISTERED FILERS":{},
TRANSFERS: {
'JF Transfers': JFTransfer,
'Joint Fundraising Transfer': JFTransfer,
},
//"REFUNDS":{},
OTHER: {
Expand Down
21 changes: 10 additions & 11 deletions front-end/cypress/support/transactions.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { TransactionTree } from './generators/transactions.spec';
import { TransactionFields } from './transaction_nav_trees.spec';
import _ from 'lodash';


//Run this on the transaction creation accordion to navigate to the desired transaction
export function navigateTransactionAccordion(category: string, transactionType: string) {
cy.get('p-accordiontab').contains('p-accordiontab', category).click();
Expand Down Expand Up @@ -32,14 +31,14 @@ export function createTransactionSchA(transactionTree: TransactionTree, save: bo
enterTransactionSchA(transaction);

if (save) {
if (transaction.childTransactions){
for (let i = 0; i < transaction["childTransactions"].length; i++){
const childTransaction = transaction["childTransactions"][i];
if (transaction.childTransactions) {
for (let i = 0; i < transaction['childTransactions'].length; i++) {
const childTransaction = transaction['childTransactions'][i];

if (i == 0){
cy.get('button[label="Save & add a JF Transfer Memo"]').click();
if (i == 0) {
cy.get('button[label="Save & add a Joint Fundraising Transfer Memo"]').click();
} else {
cy.get('button[label="Save & add another JF Transfer Memo"]').click();
cy.get('button[label="Save & add another Joint Fundraising Transfer Memo"]').click();
}
cy.medWait();
enterTransactionSchA(childTransaction);
Expand All @@ -50,7 +49,7 @@ export function createTransactionSchA(transactionTree: TransactionTree, save: bo
}
}

export function enterTransactionSchA(transaction: Transaction){
export function enterTransactionSchA(transaction: Transaction) {
const fields = Object.keys(transaction);

//Gets the value of the first field-key in the form that starts with "entityType"
Expand All @@ -62,7 +61,7 @@ export function enterTransactionSchA(transaction: Transaction){
];

for (const field of fields) {
if (field == "childTransactions") continue;
if (field == 'childTransactions') continue;

const fieldRules = TransactionFields[field];
const fieldName = fieldRules['fieldName'];
Expand All @@ -81,7 +80,7 @@ export function enterTransactionSchA(transaction: Transaction){
}
}

function fillFormField(fieldName: string, fieldValue: string, fieldType: string){
function fillFormField(fieldName: string, fieldValue: string, fieldType: string) {
switch (fieldType) {
case 'Text':
cy.get(`input[formControlName=${fieldName}]`).safeType(fieldValue);
Expand All @@ -99,4 +98,4 @@ function fillFormField(fieldName: string, fieldValue: string, fieldType: string)
cy.calendarSetValue(`p-calendar[formControlName=${fieldName}]`, fieldValue);
break;
}
}
}
18 changes: 9 additions & 9 deletions front-end/src/app/shared/models/scha-transaction.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export enum ScheduleATransactionTypes {
RETURNED_BOUNCED_RECEIPT_PAC = 'PAC_RET',
// Transfers
TRANSFERS = 'TRAN',
JF_TRANSFERS = 'JF_TRAN',
JF_TRANSFER = 'JF_TRAN',
JF_TRAN_PAC_MEMO = 'JF_TRAN_PAC_MEMO',
IN_KIND_TRANSFER = 'IK_TRAN',
IN_KIND_TRANSFER_FEA = 'IK_TRAN_FEA',
Expand Down Expand Up @@ -172,21 +172,21 @@ export const ScheduleATransactionTypeLabels: LabelList = [
[ScheduleATransactionTypes.RETURNED_BOUNCED_RECEIPT_PAC, 'Returned/Bounced Receipt (PAC)'],
// Transfers
[ScheduleATransactionTypes.TRANSFERS, 'Transfers'],
[ScheduleATransactionTypes.JF_TRANSFERS, 'JF Transfers'],
[ScheduleATransactionTypes.JF_TRAN_PAC_MEMO, 'JF Transfer PAC Memos'],
[ScheduleATransactionTypes.JF_TRANSFER, 'Joint Fundraising Transfer'],
[ScheduleATransactionTypes.JF_TRAN_PAC_MEMO, 'PAC Joint Fundraising Transfer Memo'],
[ScheduleATransactionTypes.IN_KIND_TRANSFER, 'In-Kind Transfer'],
[ScheduleATransactionTypes.IN_KIND_TRANSFER_FEA, 'In-Kind Transfer-FEA'],
[ScheduleATransactionTypes.IN_KIND_TRANSFER_FEA, 'In-Kind Transfer - Federal Election Activity'],
[
ScheduleATransactionTypes.JF_TRANSFER_NATIONAL_PARTY_RECOUNT_ACCOUNT,
'JF Transfer - National Party Recount Account',
'Joint Fundraising Transfer - National Party Recount Account',
],
[
ScheduleATransactionTypes.JF_TRANSFER_NATIONAL_PARTY_CONVENTION_ACCOUNT,
'JF Transfer - National Party Convention Account',
'Joint Fundraising Transfer - National Party Convention Account',
],
[
ScheduleATransactionTypes.JF_TRANSFER_NATIONAL_PARTY_HEADQUARTERS_ACCOUNT,
'JF Transfer - National Party Headquarters Account',
'Joint Fundraising Transfer - National Party Headquarters Account',
],
// Refunds
[
Expand All @@ -200,14 +200,14 @@ export const ScheduleATransactionTypeLabels: LabelList = [
// Other
[ScheduleATransactionTypes.OFFSETS_TO_OPERATING_EXPENDITURES, 'Offsets to Operating Expenditures'],
[ScheduleATransactionTypes.OTHER_RECEIPTS, 'Other Receipts'],
[ScheduleATransactionTypes.IND_RECEIPT_NON_CONTRIBUTION_ACCOUNT, 'Ind. Receipt - Non-Contribution Account'],
[ScheduleATransactionTypes.IND_RECEIPT_NON_CONTRIBUTION_ACCOUNT, 'Individual Receipt - Non-Contribution Account'],
[
ScheduleATransactionTypes.OTHER_COMMITTEE_RECEIPT_NON_CONTRIBUTION_ACCOUNT,
'Other Committee Receipt - Non-Contribution Account',
],
[
ScheduleATransactionTypes.BUSINESS_LABOR_ORG_RECEIPT_NON_CONTRIBUTION_ACCOUNT,
'Business/Labor Org. Receipt - Non-Contribution Account',
'Business/Labor Organization Receipt - Non-Contribution Account',
],
[ScheduleATransactionTypes.INDIVIDUAL_RECOUNT_RECEIPT, 'Individual Recount Receipt'],
[ScheduleATransactionTypes.PARTY_RECOUNT_RECEIPT, 'Party Recount Receipt'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ describe('JF_TRAN', () => {
it('#factory() should return a SchATransaction', () => {
const txn: SchATransaction = transactionType.getNewTransaction();
expect(txn.form_type).toBe('SA12');
expect(txn.transaction_type_identifier).toBe(ScheduleATransactionTypes.JF_TRANSFERS);
expect(txn.transaction_type_identifier).toBe(ScheduleATransactionTypes.JF_TRANSFER);
});

it('#contributionPurposeDescripReadonly() should return constant', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { SchATransaction, ScheduleATransactionTypeLabels, ScheduleATransactionTy
export class JF_TRAN implements TransactionType {
scheduleId = 'A';
componentGroupId = 'E';
title = LabelUtils.get(ScheduleATransactionTypeLabels, ScheduleATransactionTypes.JF_TRANSFERS);
title = LabelUtils.get(ScheduleATransactionTypeLabels, ScheduleATransactionTypes.JF_TRANSFER);
schema = schema;
transaction = null;
parent = null;
Expand All @@ -18,7 +18,7 @@ export class JF_TRAN implements TransactionType {
getNewTransaction() {
return SchATransaction.fromJSON({
form_type: 'SA12',
transaction_type_identifier: ScheduleATransactionTypes.JF_TRANSFERS,
transaction_type_identifier: ScheduleATransactionTypes.JF_TRANSFER,
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ describe('TransactionResolver', () => {
resolver.resolve(route as ActivatedRouteSnapshot).subscribe((response: TransactionType | undefined) => {
expect(response).toBeTruthy();
if (response) {
expect(response.title).toEqual('JF Transfer PAC Memos');
expect(response.title).toEqual('PAC Joint Fundraising Transfer Memo');
}
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ <h3>Additional Information</h3>
<button
pButton
pRipple
label="Save & add a JF Transfer Memo"
label="Save & add a Memo"
icon="pi pi-plus"
class="p-button-warning"
(click)="save('add-sub-tran', 'JF_TRAN_PAC_MEMO')"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ <h3>Additional Information</h3>
<button
pButton
pRipple
label="Save & add another JF Transfer Memo"
label="Save & add another Memo"
icon="pi pi-plus"
class="p-button-warning"
(click)="save('add another')"
Expand All @@ -261,7 +261,7 @@ <h3>Additional Information</h3>
<button
pButton
pRipple
label="Back to JF Transfer"
label="Back to Joint Fundraising Transfer"
class="p-button-secondary"
(click)="navigateTo('to-parent')"
></button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export class TransactionTypePickerComponent implements OnInit, OnDestroy {
case ScheduleATransactionGroups.TRANSFERS:
return [
ScheduleATransactionTypes.TRANSFERS,
ScheduleATransactionTypes.JF_TRANSFERS,
ScheduleATransactionTypes.JF_TRANSFER,
ScheduleATransactionTypes.IN_KIND_TRANSFER,
ScheduleATransactionTypes.IN_KIND_TRANSFER_FEA,
ScheduleATransactionTypes.JF_TRANSFER_NATIONAL_PARTY_RECOUNT_ACCOUNT,
Expand Down

0 comments on commit d5c54ca

Please sign in to comment.