Skip to content

Commit

Permalink
fix: fixed can id filtering
Browse files Browse the repository at this point in the history
  • Loading branch information
weimiao67 committed Feb 27, 2025
1 parent a80244c commit 6f5c676
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 2 deletions.
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

0 comments on commit 6f5c676

Please sign in to comment.