Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release/sprint 16 #670

Merged
merged 105 commits into from
Nov 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
105 commits
Select commit Hold shift + click to select a range
76340e6
WIP Transaction creation overhaul
Elaine-Krauss-TCG Oct 17, 2022
9adb3f7
Completely redesigns contact object generation
Elaine-Krauss-TCG Oct 18, 2022
74f242c
Updates Cypress to the latest version
Elaine-Krauss-TCG Oct 18, 2022
d481655
Transactions expect to be entered with specific contact details
Elaine-Krauss-TCG Oct 18, 2022
91180c7
Adds a wait to prevent a possible timing error
Elaine-Krauss-TCG Oct 18, 2022
d382d48
Brings transactions back into working condition
Elaine-Krauss-TCG Oct 18, 2022
1b60946
Updates transaction entering to account for an edge case involving mu…
Elaine-Krauss-TCG Oct 19, 2022
67ed8a0
Brings transaction creation group A into working order
Elaine-Krauss-TCG Oct 19, 2022
31a3c94
Brings field testing back into working order
Elaine-Krauss-TCG Oct 19, 2022
11aedde
WIP Aggregation Test
Elaine-Krauss-TCG Oct 19, 2022
648a6a4
Merges in changes to develop
Elaine-Krauss-TCG Oct 19, 2022
8dc6ece
Repairs a few tests that were broken in the merge
Elaine-Krauss-TCG Oct 19, 2022
1e0bc18
New E2E test checks aggregations
Elaine-Krauss-TCG Oct 20, 2022
f4d6f86
Removes console.log statements
Elaine-Krauss-TCG Oct 20, 2022
bc6f154
New E2E test satisfies tickets 243 and 549
Elaine-Krauss-TCG Oct 20, 2022
f42c2da
Fixes code smells
Elaine-Krauss-TCG Oct 20, 2022
ebf2351
use validate hash with transfer
toddlees Oct 20, 2022
f676339
Merge branch 'develop' into feature/616-sprint-14-e2e-tests
Elaine-Krauss-TCG Oct 21, 2022
549f239
Updates the package files
Elaine-Krauss-TCG Oct 21, 2022
0dbad51
Removes stray console.log statements
Elaine-Krauss-TCG Oct 21, 2022
9fe4cb9
Merge branch 'release/sprint-15' into develop
dheitzer Oct 21, 2022
f957bc8
Big Prettier pass
Elaine-Krauss-TCG Oct 21, 2022
33b7070
Updates transaction form labels
Elaine-Krauss-TCG Oct 21, 2022
c012e00
Updates transaction form labels
Elaine-Krauss-TCG Oct 21, 2022
8aeed98
552 update scha tran contact on front-end
dheitzer Oct 21, 2022
e1ae270
Adds the Party Receipt model
Elaine-Krauss-TCG Oct 21, 2022
d32ca31
update validate hash
toddlees Oct 21, 2022
1728e23
another validation update
toddlees Oct 21, 2022
d9e9207
first step squeezing transfer into group-f
toddlees Oct 21, 2022
d2aa9b2
Merge pull request #628 from fecgov/release/sprint-15
mjtravers Oct 24, 2022
78212ab
Merge pull request #627 from fecgov/feature/616-sprint-14-e2e-tests
mjtravers Oct 24, 2022
e04aed0
Merge branch 'develop' into feature/552-show-one-of-each-contact
mjtravers Oct 24, 2022
d82d0ff
Transactions are displayed as "Unitemized" when certain qualification…
Elaine-Krauss-TCG Oct 24, 2022
d107b0c
Updates unit tests
Elaine-Krauss-TCG Oct 24, 2022
04fd70f
Fixed bug in updating contact values in transaction form
mjtravers Oct 24, 2022
9396479
transitioning to configurable navigation controls
toddlees Oct 25, 2022
5d1d358
Updated valdiate commit hash
mjtravers Oct 25, 2022
c94a9d3
Merge pull request #630 from fecgov/feature/552-show-one-of-each-contact
mjtravers Oct 25, 2022
e5fc9a1
Merge pull request #629 from fecgov/feature/570-Update-Transaction-Fi…
mjtravers Oct 25, 2022
bf1a095
Merge pull request #638 from fecgov/feature/302-transaction-unitimize…
mjtravers Oct 25, 2022
d3d37d4
Adds two new E2E tests
Elaine-Krauss-TCG Oct 26, 2022
8d4edcf
Removes unused import
Elaine-Krauss-TCG Oct 26, 2022
0d81533
Entering a transaction no longer sets the entity type a second time i…
Elaine-Krauss-TCG Oct 26, 2022
766d547
Adds new E2E test for app ticket 276
Elaine-Krauss-TCG Oct 26, 2022
f1e0255
Removes unused imports
Elaine-Krauss-TCG Oct 26, 2022
504c84a
nav control refactor
toddlees Oct 26, 2022
4bbcaf7
consolidate control definitions
toddlees Oct 26, 2022
b6d9a7a
Merge pull request #654 from fecgov/feature/653-e2e-tests-sprint-15
mjtravers Oct 26, 2022
515599b
navigation control bar
toddlees Oct 26, 2022
2311ad4
disabled condition
toddlees Oct 27, 2022
48e8bb5
Merge branch 'develop' of https://github.com/fecgov/fecfile-web-app i…
toddlees Oct 27, 2022
456c2f4
add isDependentChild to transfer
toddlees Oct 27, 2022
08ac436
tests use navigationdestination and update validate hash
toddlees Oct 27, 2022
800f2ca
linting
toddlees Oct 27, 2022
4a1913e
linting
toddlees Oct 27, 2022
e660ec0
more linting
toddlees Oct 27, 2022
f2b65d2
derive sub transaction types from transaction type rather than group
toddlees Oct 27, 2022
775a21f
use transactiontype instead of string
toddlees Oct 27, 2022
7e82e9e
unit test fixes
toddlees Oct 27, 2022
e047f11
more test fixes. handling cases where child doesn't exist yet
toddlees Oct 27, 2022
9ae0d1e
whoops forgot file
toddlees Oct 27, 2022
aa6938e
excersice a bit more code
toddlees Oct 27, 2022
bebab33
lil bit of stub code
toddlees Oct 27, 2022
8621298
template fix
toddlees Oct 27, 2022
f211cdc
Refactored group AG template to use input components
mjtravers Oct 27, 2022
d548cc7
more coverage
toddlees Oct 27, 2022
022b54e
more coverage
toddlees Oct 28, 2022
7d7ba12
really more coverage
toddlees Oct 28, 2022
64ba910
rename field and lint
toddlees Oct 28, 2022
2a0176c
add clarity
toddlees Oct 28, 2022
4a4760c
Merge pull request #640 from fecgov/feature/492-transfer
mjtravers Oct 28, 2022
8857f5f
transfer shouldn't have any inline controls
toddlees Oct 28, 2022
256c2c6
unused imports
toddlees Oct 28, 2022
9742118
correct default disable condition
toddlees Oct 31, 2022
8d4b4bd
Merge pull request #658 from fecgov/feature/492-transfer
mjtravers Oct 31, 2022
9350378
Updates for party receipt transaction page
mjtravers Oct 31, 2022
f05aa32
Merge branch 'develop' into feature/481-Party-Receipt
mjtravers Oct 31, 2022
672401a
add save another button
toddlees Nov 1, 2022
521c4bd
Fix handling of required memo_code property value
mjtravers Nov 1, 2022
93bee5a
Correction in transaction AG unit test
mjtravers Nov 1, 2022
1af056f
Update validate commit hash
mjtravers Nov 1, 2022
6d3fe7b
Merge pull request #660 from fecgov/feature/492-transfer
mjtravers Nov 1, 2022
05d1791
Merge pull request #659 from fecgov/feature/481-Party-Receipt
mjtravers Nov 1, 2022
0591e71
Merge branch 'develop' into 622-ag-template-components
mjtravers Nov 1, 2022
9721c61
PAC RECEIPT
toddlees Nov 1, 2022
af973d8
Fix to unit tests and cleanup of scss files
mjtravers Nov 1, 2022
399b4a8
447 initial dev/local testing
dheitzer Nov 2, 2022
8da2c6e
447 cr changes
dheitzer Nov 2, 2022
809e48a
447 cr changes
dheitzer Nov 2, 2022
45fc04b
Merge pull request #664 from fecgov/feature/482-pac-receipt
mjtravers Nov 2, 2022
650393c
448 initial dev/local testing
dheitzer Nov 2, 2022
854ce97
Update unit tests
mjtravers Nov 2, 2022
879f0a0
448 add tests for group d changes
dheitzer Nov 2, 2022
d0fb81a
Merge branch 'develop' into feature/447-party-jf-tran-memo
mjtravers Nov 2, 2022
0ebec6b
Updated package-lock.json
mjtravers Nov 2, 2022
489c6a1
Update package.json
mjtravers Nov 2, 2022
032dc70
Merge pull request #665 from fecgov/feature/447-party-jf-tran-memo
mjtravers Nov 2, 2022
1726d68
Merge pull request #655 from fecgov/622-ag-template-components
mjtravers Nov 2, 2022
382325f
448 schema updates
dheitzer Nov 3, 2022
e858c0d
451 initial dev/local testing
dheitzer Nov 3, 2022
fa980e7
451 add unit test
dheitzer Nov 3, 2022
bf4536f
Merge branch 'develop' into feature/448-tribal-jf-tran-memo
dheitzer Nov 3, 2022
0afc637
Merge pull request #666 from fecgov/feature/448-tribal-jf-tran-memo
dheitzer Nov 3, 2022
630a6ea
Merge branch 'develop' into feature/451-ind-jf-tran-memo
dheitzer Nov 3, 2022
afb145d
Merge pull request #667 from fecgov/feature/451-ind-jf-tran-memo
dheitzer Nov 3, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 6 additions & 71 deletions front-end/cypress/e2e/general/login.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,6 @@ const errorEmail = '.error__email-id';
const errorCommitteeID = '.error__committee-id';
const errorPassword = '.error__password-error';

//two-factor authentication page form-fields' ids
const fieldTwoFactorEmail = '#email';
const fieldTwoFactorPhoneText = '#phone_number_text';
const fieldTwoFactorPhoneCall = '#phone_number_call';
const fieldTwoFactorSubmit = '.action__btn.next';

//security code page form-fields' ids
const fieldSecurityCodeText = '.form-control';
const fieldSecurityCodeNext = '.action__btn.next';

/*

Supporting Functions
Expand All @@ -39,19 +29,11 @@ function fillLoginForm() {
}

//Logs in without entering anything for Two Factor Authentication
function loginNoTwoFactor() {
function login() {
fillLoginForm();
cy.get(fieldPassword).safeType('{enter}');
}

//Logs in and requests Two Factor Authentication via Email
function loginRequestTwoFactorAuth() {
loginNoTwoFactor();

cy.get(fieldTwoFactorEmail).check();
cy.get(fieldTwoFactorSubmit).click();
}

/*

Cypress E2E Tests
Expand All @@ -75,71 +57,24 @@ describe('Testing login', () => {
fillLoginForm();

cy.get(fieldPassword).safeType('{enter}');
cy.url().should('contain', '/twoFactLogin');
cy.url().should('contain', '/dashboard');
});

it('Submits Email/committee ID/password with a click', () => {
fillLoginForm();

cy.get(fieldLoginButton).click();
cy.url().should('contain', '/twoFactLogin');
});

it('Submits Two Factor Auth via Email', () => {
loginNoTwoFactor();

cy.get(fieldTwoFactorEmail).check();
cy.get(fieldTwoFactorSubmit).click();
cy.url().should('contain', '/confirm-2f');
});

it('Submits Two Factor Auth via phone, text', () => {
loginNoTwoFactor();

cy.get(fieldTwoFactorPhoneText).check();
cy.get(fieldTwoFactorSubmit).click();
cy.url().should('contain', '/confirm-2f');
});

it('Submits Two Factor Auth via phone, call', () => {
loginNoTwoFactor();

cy.get(fieldTwoFactorPhoneCall).check();
cy.get(fieldTwoFactorSubmit).click();
cy.url().should('contain', '/confirm-2f');
});

it('Fully logs in through Two Factor Authentication with {enter}', () => {
loginRequestTwoFactorAuth();

cy.get(fieldSecurityCodeText).safeType(testPIN).safeType('{enter}');
cy.url().should('contain', '/dashboard');
cy.logout();
});

it('Fully logs in through Two Factor Authentication with a click', () => {
loginRequestTwoFactorAuth();

cy.get(fieldSecurityCodeText).safeType(testPIN);
cy.get(fieldSecurityCodeNext).click();
cy.url().should('contain', '/dashboard');
cy.logout();
});

it('Logs in and checks for Committee Account Details', () => {
loginRequestTwoFactorAuth();

cy.get(fieldSecurityCodeText).safeType(testPIN);

cy.intercept(
"GET", "https://api.open.fec.gov/v1/committee/*/*"
).as("GetCommitteeAccount");
cy.intercept('GET', 'https://api.open.fec.gov/v1/committee/*/*').as('GetCommitteeAccount');

cy.get(fieldSecurityCodeNext).click();
login();

cy.wait("@GetCommitteeAccount");
cy.wait('@GetCommitteeAccount');
cy.url().should('contain', '/dashboard');
cy.get(".committee-banner").contains(committeeID).should("exist");
cy.get('.committee-banner').contains(committeeID).should('exist');

cy.logout();
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// @ts-check

import { generateContactToFit } from '../../support/generators/contacts.spec';
import {
generateConfirmationDetails,
generateFilingDetails,
Expand All @@ -9,6 +10,7 @@ import { generateTransactionObject } from '../../support/generators/transactions

const report = generateReportObject();
const transaction = generateTransactionObject();
const contact = generateContactToFit(transaction);
const confirmationDetails = generateConfirmationDetails();
const filingDetails = generateFilingDetails();

Expand All @@ -17,6 +19,12 @@ describe('Test creating and submitting a report', () => {
cy.login();
});

after('', () => {
cy.login();
cy.visit('/dashboard');
cy.deleteAllReports();
});

it('', () => {
cy.visit('/dashboard');
cy.get('.p-menubar').find('.p-menuitem-link').contains('Reports').click();
Expand All @@ -27,7 +35,7 @@ describe('Test creating and submitting a report', () => {
cy.navigateToTransactionManagement();

//Creates a transaction
cy.createTransactionSchA(transaction);
cy.createTransactionSchA(transaction, contact);

//Checks pre-existing confirmation details
cy.navigateReportSidebar('Submit', 'Confirm information');
Expand Down Expand Up @@ -86,7 +94,5 @@ describe('Test creating and submitting a report', () => {
const date = `${months[d.getMonth()]} ${d.getDate()}, ${d.getFullYear()}`;
cy.get('body').should('contain', date);
}

cy.deleteAllReports();
});
});
4 changes: 3 additions & 1 deletion front-end/cypress/e2e/reports/Reports-Web-Print.cy.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
// @ts-check

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

const report = generateReportObject();
const transaction = generateTransactionObject();
const contact = generateContactToFit(transaction);

describe('Test creating a report and submitting it for web print', () => {
before('Logs in and clears existing reports', () => {
Expand All @@ -24,7 +26,7 @@ describe('Test creating a report and submitting it for web print', () => {
cy.navigateToTransactionManagement();

//Creates a transaction
cy.createTransactionSchA(transaction);
cy.createTransactionSchA(transaction, contact);

//Submits the report to web print
cy.navigateReportSidebar('Review', 'View print preview');
Expand Down
4 changes: 3 additions & 1 deletion front-end/cypress/e2e/sprint-10/sprint-10-test-125.cy.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { generateContactIndividual } from '../../support/generators/contacts.spec';
import { generateReportObject } from '../../support/generators/reports.spec';
import { generateTransactionObject } from '../../support/generators/transactions.spec';

Expand Down Expand Up @@ -48,12 +49,13 @@ describe('QA Script 125 (Sprint 10)', () => {
cy.medWait();
cy.navigateToTransactionManagement();

const contact = generateContactIndividual({});
const transaction = generateTransactionObject({
'INDIVIDUALS/PERSONS': {
'Individual Receipt': {},
},
});
cy.createTransactionSchA(transaction);
cy.createTransactionSchA(transaction, contact);
cy.medWait();
}

Expand Down
21 changes: 15 additions & 6 deletions front-end/cypress/e2e/sprint-10/sprint-10-test-347.cy.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { generateContactCommittee } from '../../support/generators/contacts.spec';
import { generateReportObject } from '../../support/generators/reports.spec';
import { generateTransactionObject } from '../../support/generators/transactions.spec';
import { createTransactionSchA } from '../../support/transactions.spec';
Expand All @@ -7,36 +8,44 @@ describe('QA Script 347 (Sprint 10)', () => {
cy.login();
cy.visit('/dashboard');
cy.deleteAllReports();
cy.deleteAllContacts();
});

before('', () => {
cy.login();
});

it('', () => {
//Logs in and creates a dummy report
cy.login();
cy.visit('/dashboard');

const report = generateReportObject();
cy.createReport(report);
cy.shortWait();
cy.get('p-button[icon="pi pi-pencil"]').click();
cy.get('p-button[icon="pi pi-pencil"]').click({ force: true });
cy.navigateToTransactionManagement();

//Tests the summary page for a report
const contactObject = generateContactCommittee({});
const transactionTree = generateTransactionObject({
TRANSFERS: {
'Joint Fundraising Transfer': {},
},
});
createTransactionSchA(transactionTree);
createTransactionSchA(transactionTree, contactObject);
cy.medWait();
const parentTransaction = transactionTree['TRANSFERS']['Joint Fundraising Transfer'];
const childTransaction = parentTransaction['childTransactions'][0];
const childName = childTransaction['contributorOrganizationName'];
const contribution = childTransaction['contributionAmount'] as number;
const convContribution = Intl.NumberFormat('en-US').format(Math.floor(contribution));

cy.contains('tr', parentTransaction['contributorOrganizationName'])
.find('>td')
cy.contains('tr', 'JOINT_FUNDRAISING_TRANSFER')
.find('td')
.eq(6)
.then(($td) => {
const parentId = $td.text();
cy.contains('tr', childName).find('td').eq(7).should('have.text', parentId);
cy.contains('tr', convContribution).find('td').eq(7).should('have.text', parentId);
});
});
});
16 changes: 14 additions & 2 deletions front-end/cypress/e2e/sprint-13/sprint-13-test-439,445.cy.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
// @ts-check

import { enterContact } from '../../support/contacts.spec';
import { generateContactToFit } from '../../support/generators/contacts.spec';
import { generateReportObject } from '../../support/generators/reports.spec';
import { generateTransactionObject } from '../../support/generators/transactions.spec';
import { createTransactionSchA } from '../../support/transactions.spec';
Expand Down Expand Up @@ -31,9 +33,19 @@ describe('QA Script 244 (Sprint 8)', () => {

//Step 4: Create a Joint Fundraising Transfer MEMO transaction
const transaction = generateTransactionObject({ TRANSFERS: { 'Joint Fundraising Transfer': {} } });
createTransactionSchA(transaction, false);
cy.get('button[label="Save & add a Memo"]').click();
const contact = generateContactToFit(transaction);
createTransactionSchA(transaction, contact, false);
cy.get('p-dropdown[formcontrolname="subTransaction"]').click();
cy.contains('li', 'PAC JF Transfer Memo').click();
cy.shortWait();
cy.get('.p-confirm-dialog-accept').click();
cy.longWait();

cy.contains('a', 'Create a new contact').click();
cy.longWait();
enterContact(contact, true, true);
cy.medWait();

cy.contains('The dollar amount in a memo item is not incorporated into the total figure for the schedule').should(
'exist'
);
Expand Down
91 changes: 91 additions & 0 deletions front-end/cypress/e2e/sprint-14/sprint-14-test-243,549.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
// @ts-check

import * as _ from 'lodash';
import {
generateContactCommittee,
generateContactIndividual,
generateContactOrganization,
} from '../../support/generators/contacts.spec';
import { generateReportObject } from '../../support/generators/reports.spec';
import { generateTransactionObject } from '../../support/generators/transactions.spec';

//Contacts
const contactIndividual = generateContactIndividual({});
const contactOrganization = generateContactOrganization({});
const contactCommittee = generateContactCommittee({});

//Individual Transactions
const indvRecTree = {
'INDIVIDUALS/PERSONS': {
'Individual Receipt': {
contributionDate: new Date('12/12/2012'),
contributionAmount: _.random(10, 500, false),
},
},
};
const tTreeIndividualA = generateTransactionObject(indvRecTree);

//Organization Transactions
const orgRecTree = {
'INDIVIDUALS/PERSONS': {
'Tribal Receipt': {
contributionDate: new Date('12/12/2012'),
contributionAmount: _.random(10, 500, false),
},
},
};
const tTreeOrganizationA = generateTransactionObject(orgRecTree);

//JF Transfer Transfers
const JFTransTree = {
TRANSFERS: {
'Joint Fundraising Transfer': {
contributionDate: new Date('12/12/2012'),
contributionAmount: _.random(10, 250, false),
},
},
};
const tTreeJFTransA = generateTransactionObject(JFTransTree);

describe('QA Script 244 (Sprint 8)', () => {
after(() => {
cy.login();
cy.visit('/dashboard');
cy.deleteAllReports();
cy.deleteAllContacts();
});

before('', () => {
//Step 1: Log in, navigate to the contacts page and create individual, organization, and committee contacts
cy.login();
cy.visit('/dashboard');
cy.url().should('contain', '/dashboard');
cy.get('.p-menubar').find('.p-menuitem-link').contains('Reports').click();
cy.medWait();

//Step 2: Create a report and navigate to the transactions page
const report = generateReportObject();
cy.createReport(report);
});

it('Tests contact creation', () => {
cy.login();
cy.visit('/dashboard');
cy.get('.p-menubar').find('.p-menuitem-link').contains('Reports').click();
cy.medWait();
cy.navigateToTransactionManagement();
cy.medWait();
cy.createTransactionSchA(tTreeIndividualA, contactIndividual);
cy.medWait();
cy.createTransactionSchA(tTreeOrganizationA, contactOrganization);
cy.medWait();
cy.createTransactionSchA(tTreeJFTransA, contactCommittee);
cy.medWait();

cy.get('.p-menubar').find('.p-menuitem-link').contains('Contacts').click();
cy.medWait();
cy.contains('td', contactIndividual['name']).should('exist');
cy.contains('td', contactOrganization['name']).should('exist');
cy.contains('td', contactCommittee['name']).should('exist');
});
});
Loading