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

Hotfix: fixed can id filtering #3544

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
27 changes: 27 additions & 0 deletions frontend/cypress/e2e/portfolioDetail.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,5 +69,32 @@ describe("Portfolio Detail Page", () => {
.should("contain", "$200,000.00 ")
.should("contain", "$0")
.should("contain", "Previous FYs Carry-Forward");

// check the can list for FY 2023
cy.get("#fiscal-year-select").select("2023");
// summary cards
cy.get('[data-cy="line-graph-with-legend-card"]')
.should("contain", "$10,200,000.00")
.should("contain", "51%")
.should("contain", "$20,000,000.00")
.should("contain", "100%");
cy.get('[data-cy="portfolio-budget-card"]')
.should("contain", "$20,000,000.00")
.should("contain", "$10,200,000.00");
// check the first can card for the correct values
cy.get('[data-cy="can-card-G990136"]')
.should("contain", "G990136")
.should("contain", "$6,000,000.00")
.should("contain", "$4,000,000.00")
.should("contain", "$0")
.should("contain", "$10,000,000.00")
.should("contain", "FY 2023 New Funding");
cy.get('[data-cy="can-card-G99IA14"]')
.should("contain", "G99IA14")
.should("contain", "$6,000,000.00")
.should("contain", "$4,000,000.00")
.should("contain", "$0")
.should("contain", "$10,000,000.00")
.should("contain", "FY 2023 New Funding");
});
});
4 changes: 2 additions & 2 deletions frontend/src/pages/portfolios/detail/PortfolioDetail.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ const PortfolioDetail = () => {
const canIds =
portfolioCans
?.filter(
/** @param {{id: number, appropriation_date: number}} can */
(can) => can.appropriation_date === fiscalYear
/** @param {import("../../../components/CANs/CANTypes").CAN} can */
(can) => can.funding_budgets?.some((budget) => budget.fiscal_year === fiscalYear)
)
.map(
/** @param {{id: number}} can */
Expand Down