Skip to content

Commit

Permalink
Merge pull request #2336 from fecgov/release/sprint-50
Browse files Browse the repository at this point in the history
Release/sprint 50
  • Loading branch information
toddlees authored Nov 13, 2024
2 parents 6592d50 + 5e4c21a commit b53014f
Show file tree
Hide file tree
Showing 120 changed files with 2,028 additions and 3,763 deletions.
25 changes: 7 additions & 18 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ version: 2.1
# See: https://circleci.com/docs/2.0/orb-intro/
orbs:
browser-tools: circleci/[email protected]
node: circleci/node@5.2.0
node: circleci/node@6.3.0
python: circleci/[email protected]

# See: https://circleci.com/docs/2.0/configuration-reference/#jobs
jobs:
lint:
docker:
- image: cimg/node:20.4.0-browsers
- image: cimg/node:lts-browsers
resource_class: large
steps:
- checkout
Expand All @@ -37,7 +37,7 @@ jobs:
# These next lines defines a Docker executors: https://circleci.com/docs/2.0/executor-types/
# A list of available CircleCI Docker convenience images are available here: https://circleci.com/developer/images/image/cimg/python
docker:
- image: cimg/node:20.4.0-browsers
- image: cimg/node:lts-browsers
resource_class: large
steps:
- checkout
Expand Down Expand Up @@ -102,7 +102,7 @@ jobs:

e2e-test:
docker:
- image: cimg/node:20.4.0-browsers
- image: cimg/node:lts-browsers
steps:
- setup_remote_docker:
docker_layer_caching: false
Expand Down Expand Up @@ -157,7 +157,7 @@ jobs:
destination: cypress/results
deploy-job:
docker:
- image: cimg/node:20.4.0-browsers
- image: cimg/node:lts-browsers
resource_class: large
steps:
- checkout
Expand All @@ -181,7 +181,7 @@ jobs:

dependency-check:
docker:
- image: cimg/node:20.4.0-browsers
- image: cimg/node:lts-browsers
- image: cimg/python:3.10-node

steps:
Expand Down Expand Up @@ -227,17 +227,6 @@ workflows:
filters:
branches:
only: /develop|release\/sprint-[\.\d]+|main/
- deploy-job: # All dependencies must pass before deploying
name: deploy-with-all-dependent-jobs-required
requires:
- lint
- test
- dependency-check
# - e2e-test
filters:
branches:
only:
- develop
- deploy-job: # Deploy job even when e2e tests fail
name: deploy-even-if-e2e-job-fails
requires:
Expand All @@ -246,7 +235,7 @@ workflows:
- dependency-check
filters:
branches:
only: /release\/sprint-[\.\d]+|main/
only: /develop|release\/sprint-[\.\d]+|main/

nightly-run:
when: << pipeline.parameters.is-nightly-run >>
Expand Down
2 changes: 1 addition & 1 deletion deploy-config/fecfile-web-app-prod-manifest.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
applications:
- name: fecfile-web-app
instances: 2
instances: 0
memory: 1G
buildpack: nginx_buildpack
stack: cflinuxfs4
Expand Down
2 changes: 1 addition & 1 deletion deploy-config/fecfile-web-app-test-manifest.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
applications:
- name: fecfile-web-app
instances: 2
instances: 4
memory: 1G
buildpack: nginx_buildpack
stack: cflinuxfs4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ describe('Form 24 Independent Expenditures', () => {
it('Independent Expenditures created on a Form 24 should be linked to a Form 3X', () => {
const f3x_report_data = {
...defaultForm3XData,
cash_on_hand: 500,
};
F3XSetup({ individual: true, candidate: true, report: f3x_report_data });
F24Setup();
Expand Down
6 changes: 3 additions & 3 deletions front-end/cypress/e2e/F3X/disbursements.cy.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Initialize, setCommitteeType } from '../pages/loginPage';
import { Initialize, setCommitteeToPTY } from '../pages/loginPage';
import { currentYear, PageUtils } from '../pages/pageUtils';
import { TransactionDetailPage } from '../pages/transactionDetailPage';
import {
Expand Down Expand Up @@ -36,7 +36,7 @@ describe('Disbursements', () => {

it('should test F3xFederalElectionActivityExpendituresPage disbursement', () => {
F3XSetup({ individual: true });
setCommitteeType('D');
setCommitteeToPTY();
StartTransaction.Disbursements().Federal().HundredPercentFederalElectionActivityPayment();

PageUtils.dropdownSetValue('#entity_type_dropdown', individualContactFormData.contact_type, '');
Expand Down Expand Up @@ -150,7 +150,7 @@ describe('Disbursements', () => {

it('Create a Credit Card Payment for 100% Federal Election Activity transaction', () => {
F3XSetup({ organization: true });
setCommitteeType('D');
setCommitteeToPTY();
StartTransaction.Disbursements().Federal().CreditCardPayment();

cy.get('[id="searchBox"]').type(organizationFormData.name.slice(0, 1));
Expand Down
6 changes: 0 additions & 6 deletions front-end/cypress/e2e/F3X/reports-f3x-amendments.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,7 @@ describe('Amendments', () => {
F3xCreateReportPage.enterFormData(reportFormData);
PageUtils.clickButton('Save and continue');

// Cash on hand
PageUtils.clickSidebarItem('Cash on hand');
const alias = PageUtils.getAlias('');
PageUtils.enterValue('#L6a_cash_on_hand_jan_1_ytd', 60000);
PageUtils.calendarSetValue('p-calendar', new Date('05/27/2024'), alias);
PageUtils.clickButton('Save & continue');

PageUtils.urlCheck('/list');
PageUtils.clickSidebarItem('SUBMIT YOUR REPORT');
PageUtils.clickLink('Submit report');
Expand Down
7 changes: 1 addition & 6 deletions front-end/cypress/e2e/F3X/reports-f3x-loans-bank.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { ReportListPage } from '../pages/reportListPage';
import { TransactionDetailPage } from '../pages/transactionDetailPage';
import { StartTransaction } from './start-transaction/start-transaction';
import { F3XSetup, reportFormDataApril, reportFormDataJuly, Setup } from './f3x-setup';
import { defaultFormData as cohFormData, F3xCashOnHandPage } from '../pages/f3xCashOnHandPage';

const formData = {
...defaultLoanFormData,
Expand All @@ -21,12 +20,8 @@ const formData = {
},
};

function setupLoanFromBank(setup: Setup, addCoh = false) {
function setupLoanFromBank(setup: Setup) {
F3XSetup(setup);
if (addCoh) {
F3xCashOnHandPage.enterFormData(cohFormData);
PageUtils.clickButton('Save & continue');
}
StartTransaction.Loans().FromBank();

PageUtils.searchBoxInput(organizationFormData.name);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ describe('Loans', () => {
cy.contains('Receive loan repayment').click({ force: true });

PageUtils.urlCheck('LOAN_REPAYMENT_RECEIVED');
PageUtils.searchBoxInput(committeeFormData.committee_id);
formData.date_received = new Date(currentYear, 4 - 1, 27);
PageUtils.calendarSetValue('p-calendar[inputid="date"]', formData.date_received);
PageUtils.enterValue('#amount', formData.amount);
Expand Down
10 changes: 1 addition & 9 deletions front-end/cypress/e2e/F3X/reports-f3x.cy.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Initialize } from '../pages/loginPage';
import { ReportListPage } from '../pages/reportListPage';
import { defaultFormData as cohFormData, F3xCashOnHandPage } from '../pages/f3xCashOnHandPage';
import { ReportLevelMemoPage } from '../pages/reportLevelMemoPage';
import { currentYear, PageUtils } from '../pages/pageUtils';
import { defaultForm3XData } from '../models/ReportFormModel';
Expand Down Expand Up @@ -67,9 +66,6 @@ describe('Manage reports', () => {
it('Create a report error for overlapping coverage dates', () => {
// Create report #1
ReportListPage.createF3X();
F3xCashOnHandPage.enterFormData(cohFormData);
PageUtils.clickButton('Save & continue');
ReportListPage.goToPage();

// Create report #2
const formData = {
Expand Down Expand Up @@ -97,12 +93,8 @@ describe('Manage reports', () => {
cy.get('label[for="12G"]').should('have.class', 'p-disabled');
});

it('Create report and save cash on hand', () => {
it('Create report and save', () => {
ReportListPage.createF3X();

F3xCashOnHandPage.enterFormData(cohFormData);
PageUtils.clickButton('Save & continue');
cy.contains('Cash on hand').should('exist');
});

xit('Check values on the Summary Page', () => {
Expand Down
2 changes: 0 additions & 2 deletions front-end/cypress/e2e/models/ReportFormModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ export class F3xCreateReportFormData {
coverage_through_date: Date;
date_of_election: Date;
state_of_election: string;
cash_on_hand?: number;

constructor(formData: F3xCreateReportFormData) {
this.filing_frequency = formData.filing_frequency;
Expand All @@ -18,7 +17,6 @@ export class F3xCreateReportFormData {
this.coverage_from_date = formData.coverage_from_date;
this.date_of_election = formData.date_of_election;
this.state_of_election = formData.state_of_election;
this.cash_on_hand = formData.cash_on_hand;
}
}

Expand Down
18 changes: 0 additions & 18 deletions front-end/cypress/e2e/pages/f3xCashOnHandPage.ts

This file was deleted.

17 changes: 11 additions & 6 deletions front-end/cypress/e2e/pages/loginPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,8 @@ function getLoginIntervalString(sessionDur: number): string {
}

function loginDotGovLogin() {
const committeeID = Cypress.env('COMMITTEE_ID');

cy.intercept('GET', 'http://localhost:8080/api/v1/oidc/login-redirect').as('GetLoggedIn');
cy.intercept('GET', `http://localhost:8080/api/v1/openfec/${committeeID}/committee/?check_can_create=false`, {
fixture: 'FEC_Get_Committee_Account',
}).as('GetCommitteeAccounts');
cy.intercept('GET', 'http://localhost:8080/api/v1/committees/').as('GetCommitteeAccounts');
cy.intercept('POST', 'http://localhost:8080/api/v1/committees/*/activate/').as('ActivateCommittee');

cy.visit('/');
Expand All @@ -74,7 +70,7 @@ function loginDotGovLogin() {
cy.wait('@GetCommitteeAccounts');
cy.get('.committee-list .committee-info').first().click();
cy.wait('@ActivateCommittee');
cy.visit('/dashboard');
//cy.visit('/dashboard');
}

function retrieveAuthToken() {
Expand All @@ -96,3 +92,12 @@ export function setCommitteeType(committeeType = 'O') {
json.committee_type = committeeType;
localStorage.setItem('fecfile_online_committeeAccount', JSON.stringify(json));
}

export function setCommitteeToPTY() {
const fecfile_online_committeeAccount = localStorage.getItem('fecfile_online_committeeAccount');
if (!fecfile_online_committeeAccount) return;
const json = JSON.parse(fecfile_online_committeeAccount);
json.isPAC = false;
json.isPTY = true;
localStorage.setItem('fecfile_online_committeeAccount', JSON.stringify(json));
}
13 changes: 1 addition & 12 deletions front-end/cypress/e2e/pages/reportListPage.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { F3xCreateReportPage } from './f3xCreateReportPage';
import { defaultForm24Data, defaultForm3XData as defaultReportFormData } from '../models/ReportFormModel';
import { PageUtils } from './pageUtils';
import { defaultFormData as cohFormData, F3xCashOnHandPage } from './f3xCashOnHandPage';

export class ReportListPage {
static goToPage() {
Expand Down Expand Up @@ -51,14 +50,6 @@ export class ReportListPage {
F3xCreateReportPage.waitForCoverage();
F3xCreateReportPage.enterFormData(fd);
PageUtils.clickButton('Save and continue');
if (fd.cash_on_hand) {
F3xCashOnHandPage.enterFormData({
cashOnHand: fd.cash_on_hand.toString(),
date: fd.coverage_from_date,
});
PageUtils.clickButton('Save & continue');
cy.contains('Transactions in this report').should('exist');
}
}

static createF1M() {
Expand All @@ -81,10 +72,8 @@ export class ReportListPage {
cy.wait(500);
}

static submitReport(reportName: string, fd = cohFormData) {
static submitReport(reportName: string) {
ReportListPage.editReport(reportName);
F3xCashOnHandPage.enterFormData(fd);
PageUtils.clickButton('Save & continue');
PageUtils.clickSidebarItem('SUBMIT YOUR REPORT');
PageUtils.clickSidebarItem('Submit report');
const alias = PageUtils.getAlias('');
Expand Down
87 changes: 0 additions & 87 deletions front-end/cypress/fixtures/FEC_Get_Committee_Account.json

This file was deleted.

Loading

0 comments on commit b53014f

Please sign in to comment.